Budget.
The Expensive Way: Lookit how they did it in Sherlock Holmes which is pretty much about it: build a harness vest with hook, build a between-ceiling-joist reinforcement, "hang" your friends and family.
"No." You can't actually suspend an adult's weight from a normal closet clothes rod or from anything up inside.
Drywall will be cut or drilled, then replastered and repainted.
Film your full on body hanging.
Sounds like a lotta work for what will likely be a very brief shot in the final product.
The Cheap Way: Suspend your rope or cord by whatever faux way you want, best keep it off camera.
Have your actor stand on something with the NON-ACTUAL NON-SLIDING NOOSE! around their neck (make a break away "noose" if you want/can), pretend to hang while standing, shoot just from the shins up.
Optional, then have the actor pull up on something, suspend feet in the air, then shoot suspended feet.
Do your best in editing to marry the two shots.
Frankly, anyone with any sense in their head will know you can't really hang yourself from anything inside a normal closet, like the clothes rod.
Now, I have heard of people hanging themselves from a cord around the shower nozzle, but that also seems a little hokey.
Balconies and second floor railings, inside or out, would definitely be "good" hanging places.
Garage door opener rail system would also work.
I'm just saying the closet borders on cliche if not just silly.
GL