The cause of the panic attacks is the mental and physical stress you are under. Panic attack origins from anxiety and fear. Anxiety means feeling scared and pessimistic about a future event. For example, if you keep on overthinking about a event and it’s possible negative outcomes. The feeling to hurt oneself comes from wanting to end the pain. I want this pain to go away and I can’t do anything about my surroundings (feeling out of control and helpless) so what can i do in this situation is take the pain away.
Next Steps
Start practicing breathing exercises where you inhale through your nose and exhale through your mouth. While doing this sit done and keep your feet on the floor. (Useful for panic attack) and start journaling your thoughts and emotions which helps you to keep a track of what is going on. Also start gratitude journal where you list down three things you are grateful for in your life.
Health Tips
I would advice you to start therapy sessions to help you come out of your problems.