Separate yourself from that feeling, and act as if it is a person. Give the same compassion you'd give to someone else who is on a ledge and ready to jump -- give that compassion to this other side of yourself. Ask this person about their needs, desires, and anything that is creating this crisis. You don't have to talk outloud; you can type it like a conversation, draw it like a cartoon, form characters in modeling clay, or use generic little plastic people. Whatever medium you use, make it meaningful, but can also be humorous.
Thinking like this might help compartmentalize the pain into a form that can be more manageable. You can also create another profile here and speak to your self-destructive persona that way. Don't give up. There are ways out of this feeling. It won't last forever. Time will bring you out eventually.