There are two types of writing: non-commercial and commercial. Or you can call them journaling (non-structured) and plotting (structured). Or some other names.
The difference between the two is: the first one is WRITING FOR PLEASURE (makes you feel better, allows you to vent emotions, entertains you, etc.) and the second one is WRITING FOR MONEY (gets you a paycheck for an article, a short story, a novel, etc.).
Then there are bad writing days and good writing days.
When you have a bad day and can’t concentrate, how to deal with it depends on what kind of writing you do, non-commercial or commercial. If you’re writing for the joy of it, purely for yourself, it might help to just spill onto the page how shitty you’re feeling. That’s the point of it. It’ll make you feel better. The more you feel while you write, the more you’ll spill, the better you’ll feel afterwards.
If, however, your writing is commercial, as in, you’re writing a novel that you intend to self-publish and would love for your readers to buy and read, when you have a bad day, forcing yourself to write won’t help. Whatever you produce will need to be rewritten anyway. So the best you can do is…
WALK AWAY UNTIL YOU’RE CALM.
Most of the reasons for feeling bad are in our heads. After all, not many of us experience real hunger anymore, real cold, or real life threats from real adversaries. Therefore, the way out of it is to cut off the source of it. Most of the time it’s screens. Your phone screen, your computer screen, your TV screen, and so on. And when it's not screens, it's people: your coworkers, your neighbors, your family. Whatever or whoever is the source of negativity, you have to walk away from it and retreat into your mind to find peace in it, without all the interruptions. Think of it as an emergency.
It’s an emergency for your creativity.
A quiet mind will produce better commercial writing than a buzzing one, because you have to concentrate on logical stuff, like plotting and character development and style and more. You can’t do it when you’re not calm, just like you couldn’t do any other job that required fierce concentration.
So turn your screens off, stop responding to whoever is talking to you, and walk away. "Burn" appointments or commitments, if you have to. It'll pay off in the long run, even if now it makes you feel scared the world will implode if you won't deliver on what you promised.
You're in this game for the long run, right? Then learn to think of it that way. Look far ahead and ask yourself, "What's a day of worry worth? How much more will I gain if I allow myself a day of peace instead? I'm worth it. Yes, I am. Because I said so. Because it's my life, and it's my dream to write, and write I will."