When youre in the elevator:
No need to talk to a stranger. But if its someone you know or, worse, your boss, say, “Hi,” then “Have a great day” as you get off. Youre being polite but not pressuring her into a stop-and-chat.
When a friend is going through a tough time:
Whatever it is, she no doubt needs to be heard. So ask how shes doing, and say “That sounds frustrating,” or “What happened next?” to let her know you are truly interested.
When youre at a party with strangers:
Lead with what brought you both there. Ask “How do you know the host?” Common ground is a great ice-breaker.