What is a healthy way to grieve? How should you grieve loss? When it hits you, what should you do?
When grieving, it is important to focus on self care. Do what you need to do to take care of yourself, your basic needs. Get enough sleep, eat right, try to do something that you find calming or pleasing.
In relationships, if the person doesn't want you, doesn't treat you well, it's their loss. There's always more fish in the sea. You can remember the good times if you want, but realize that there were unhealthy parts of the relationship. If you still love her, you can feel good that she was in your life but she needs to go on her journey now, and one day maybe your paths will cross again, or maybe not. If she can't be civil to you, you need to leave her alone for your own good and hers.
Use mindfulness, try to focus on the present. If you find yourself thinking unhealthy obsessive thoughts replace them with better thoughts, positive affirmations like "I can get through this." Being mindful is about being in the present, the here and now, not worrying too much about the past or future. Observe your senses to keep in the present. Take some deep breaths. Focusing on the "What if..?" 's will consume your energy, time and produce anxiety. Focus on caring for yourself right now and you'll feel better and people will respect you more, including your wife/exwife.
Surround yourself with family and friends that are supportive. Even pets can be therapeutic and help you get through difficult times, because they love you. Immerse yourself in work, self care activities, education, or do home improvement projects, whatever you need to do to move forward. Additionally, don't hop into another unhealthy relationship because that is just something on the rebound. Try to keep your head up. Breakups are often difficult but it definitely gets easier with time.