You can relax by taking a few deep breathes and remaining calm. There is no need to panic. Try to engage yourself in something that makes you comfortable. Never try to climb out of an elevator. There have been cases where people have fallen down the shaft trying to climb out of an elevator.
Every elevator has an alarm button and an intercom or phone.
In large buildings, an on-site elevator supervisor should respond to your call within five minutes. Some people have fallen when the elevator suddenly restarted. Don't worry about being in the dark. Lighting runs on a separate circuit. Even if it does go out, there is a backup system that would kick in for up to four hours.