There are multiple methods that you can try to utilize to clear your mind. It's important to realize that no matter how chaotic your life may be that you are in control of your mind and what you are thinking at any given time.

Distraction is a powerful tool if you can harness it for yourself, instead of feeling like you're at the mercy of distractions. When you realize you're thinking about something you don't want to think about, either look for something else to focus on, or deliberately focus on something you do and keep thinking about that.

Suppression is more useful for erasing your mind of memories and traumatic experiences that you wished never happened. Don't like a thought? Disregard it. It's like dragging and dropping a file into your computer's recycle bin. You don't need to think about it. Forget it. Do this enough times without thinking about something and you will forget about it.

Substitution can be particularly useful for putting yourself in the frame of mind to write. By replacing your thoughts and allowing your imagination some time to take over, you can swap what you're experiencing for something else. Close your eyes and imagine yourself as your character, in another time and place, doing entirely different things. Just be careful not to bump into walls or pointy objects...

Meditation is, in my opinion, the most effective practice for the long run. It requires taking seriously, but given a chance, will have some rather radical benefits on your brain. Look into it, gain an understanding of how to properly meditate, and do it. Doesn't take long. 5 minutes each day. Be consistant with it and you'll see. Meditation is buddhist monk magic for clearing your mind of unwanted thoughts.