Divorce. Nobody thinks it’ll happen to them yet (depending on which statistics you believe) nearly 50% of marriages don’t make it. While nobody plans on getting married only to get divorced, if you do happen to be stuck in that process, you’ll know that it’s one of the most stressful, difficult, and painful processes you’ll ever go through.

If you’re going through a divorce, you’ll be familiar with all the costs, both monetary as well as emotional, that it entails. This also affects your work, bogging you down, limiting your creativity, and, if the divorce is less than harmonious, as is often the case, physically taking you out of your office and leaving you stuck in courtrooms and law offices for mediation.

When in the process of getting a divorce, it can seem like the world around you is crumbling. The last thing you want is for your career to fall apart as well. Luckily, a small silver lining of divorce is that it is absolutely possible to preserve your career during and after divorce. The following tips should give you a good base for maintaining professional success.

1) Keep Divorce-Related Communications to a Minimum

While divorce is nothing trivial, it can become a distraction at work simply due to the time spent thinking about it and focusing on it in place of what you really should be doing. One good idea is to simply manage your divorce proceedings after business hours rather than during the work day.

If 9 to 5 correspondence on your divorce is necessary, give yourself a small window during the day, 10:00-11:00, for example, to allow yourself to be distracted by your divorce, send emails to your lawyer, or work out issues with your partner or kids, and then devote the rest of your day to your work.

2) Keep your Boss in the Know

While you should do your best to keep your divorce out of your work, it’s inevitable that the quality of your work might suffer a bit, or that you’ll have to miss time out of the workday to have divorce-related meetings.

Make sure that your boss knows from the outset what you’re going through. This way, he or she will know what it is that’s distracting you, and if they’re any good at all, will work with you to find a way to compensate for time lost to divorce proceedings.

The last thing you want is for your boss to think that you’ve lost your motivation, and you definitely want to be available throughout the day to meet with lawyers or go to court if necessary. You’ll have to communicate with your boss about these issues and trust that your boss will accommodate your schedule into your work environment.

3) Compartmentalize

When going through a divorce, you’ll have to learn to understand how all relationships in your lie function, not just the one you had with your partner. You’ll have to learn the difference between a working relationship, a romantic relationship, or just a friendship.

As you compartmentalize, you’ll be able to move past difficult situations that would otherwise call up sore feelings. Look at HGTV’s Flip or Flop stars Tarek and Christina El Moussa, for example. You’ve likely seen articles or tabloid covers talking about their divorce, but you may not realize that the two are still actually continuing to work together despite everything.

While the pain of going through a divorce is real, if you can gain a good understanding of the nature of each of your relationships, you’ll still be able to be productive and succeed in the workplace.

4) Learn New Skills

Once your divorce is finalized, there’s a fairly good chance you’ll have a lot more time on your hands. You can use this time to spiral out and allow the moment to get the best of you, or you can take your newfound free time and invest it into learning a new skill.

Not only can this make you a more appealing option to future employers, but it will keep your mind engaged on productive tasks and keep you from falling into a distracted malaise that will affect both your personal and professional lives.

5) Stay Healthy

It should come as little surprise that, especially for men, health tends to decline after divorce. You’ll find yourself eating a lot more solo meals than you did before, and it can be easy to fall into the temptation of fast food rather than having to cook for yourself.

Maintaining health is paramount to professional success and personal fulfillment. Take your divorce as an opportunity to form new eating and exercise habits that will lead you to a healthier future.

Nothing will make a divorce easy, and nothing can completely keep your divorce from affecting your work. However, if you focus on maintaining healthy and productive habits at work and at home, including but not limited to the ones above, you can minimize the negative impact your divorce will have on your work life.