Working the brain is like working the body, sometimes it's hard and you feel a lot of resistance ("I can't do this"), especially when you're out of practice. The more you push through and exercise the writing muscles, the easier words usually flow as you get into the habit of working at the same time every day. Still, just like your physical condition effects your workouts, your emotional or psychological state can effect your writing.
Some causes of that may be exhaustion, depression, anxiety, difficulty concentrating, illness sapping energy, stress, distraction (such as financial issues or sick loved ones), or medication causing muddled thinking.
Then there's the creative stuff, like confusion about where the story is going, and growing bored with your plot or characters.
For published writers, there's also discouragement over negative feedback, lowered enthusiasm after poor sales, fear that nobody's going to read the next book.
The first step to fixing it is probably figuring out the cause. I tend to think for most people, especially newer writers, it's low motivation and difficulty easing into a consistent routine. When there's no accountability, it can be hard to prioritize a thing that you're not feeling inspired to do right now. That's why some people find writing sprints with friends helpful. Also, publicly sharing a goal with regular progress updates.