That usually happens if you did something that is outta sync with your values & beliefs or you hurt someone.
You can obvi change your behavior to be better aligned.
And apologize and try to make amends with whoever you hurt, but it’s up to them if they will accept your apology. If they don’t — they may eventually — you need to accept it, be at peace with it and move on.
I think you should go see a therapist and talk to someone.
And go watch something funny and be gentle with yourself. Do better next time!