Push a floor or "door open" button. If you are indeed stuck, the elevator obviously won't move but the doors can still be opened. This is helpful if you are in a position to see the floor, either above or below, and can escape by climbing onto it.
Look for a working emergency phone. Sometimes elevators have these enclosed in a section along the wall. If one isn't available, press the emergency call button which is normally bright red in color. Hold it down or push it 2-3 times in rapid succession to ensure that you get someone's attention quickly then wait a few seconds before trying again.
Bang on the door. Use your shoe or other hard object to avoid hurting yourself. If someone is walking by in the corridor outside, they are more likely to hear your "distress call" and get help.
Yell loudly. Calling for help as loud as you can may attract someone's attention. Be sure to stop and listen for a few seconds before repeating so you can hear if someone is trying to talk to you from outside.
Use your cell phone. Depending on the building, you may still have reception even in the elevator. Call 911 or even a friend if they happen to live close by. Let them know you're stuck so they can get in touch with the fire department.