Being a fighter pilot is not a safe profession, but if your passion brings you to it, you will learn all the ways of surviving. When a fighter jet finds itself on the verge of failure, the pilot will need to get out of the plane, in a condition good enough to be able to live, even if he or she can not fly again.
Now the question is, what would happen if the pilot pushed eject, the seat fires but the canopy refuses to open as it does in movies like Top Gun?
In some fighters like the F-16, the seat does not fire until the jet gets rid of the canopy. In most other aircraft, canopy breakers are built into the seats that break the glass on the way out saving at least a second. Other jets have explosives embedded into the plexiglass, that tear it down to shreds milliseconds before the seat moves.
Here is a video of the AV-8B Harrier II taking off from the pilot’s perspective. The curvy lines in the cockpit glass are the explosives that blow off the canopy in the event of failure.