This is a bit of elevator etiquette I tried to teach my sons.
When you’re in a elevator with a woman:
1) Stand in front facing the doors so she can see you and so she doesn’t feel like you’re leering at her. Don’t stand up against the wall.
2) If it’s clear you’re both getting off at the floor, always go first so she doesn’t feel like you’re following her.
It feels rude, but she we feel more safe.