Space is dangerous. With this in mind, the now-defunct Intersector Shipbuilding Company developed the rescue pod system. Rescue pods are partly memory metal, partly inflatable, and can deploy near-instantly in the midst of a starship losing structural integrity. Electromagnetic manipulators dedicated to the task will place all crew members swiftly into the pod.
In other words, if your starship is destroyed, you will find yourself in a rescue pod. Starships also additionally contain a single escape pod which can be deployed manually. If you wish to manually escape your ship, simply use the ESCAPE command. Note that this leaves your ship intact but empty; if you wish to destroy your ship, check the Self-Destruct help file.
Rescue pods are fully automated for your own safety. Using sublight autopilot, a built-in wormhole drive, and even a rift drive, your pod will transport you to your home port in the most efficient manner. Using the DESTINATION command, you can change your pod's destination to another alliance's port, as long as diplomatic relations allow you to land there.
If you are on the other side of the skim gate from your home port, you will probably very much want to use this DESTINATION command. Otherwise, your pod will spend hours crossing the space that the skim gate covers.