Understand that everything happens for a reason. When something bad happened it is not an indication that you are a bad person, it might be just a massive nudge from the universe to get onto your right path.
Do not let a person or an event that was painful in the past hurt you in the present or future. They already stole your joy in the past so do not give them permission to destroy your present or future.
Ask yourself WHAT you can do to be happy again and heal instead of WHY that has happened to you.