Human beings are of such nature that they should have not only material facilities but spiritual sustenance as well. Without spiritual sustenance, it is difficult to get and maintain peace of mind.
I think what gets you through a small writing project, is just one burst of inspiration. A book, especially a longer book, it's a different kind of force that pushes you through it. It's a vision of the whole thing.
The urge to create a fictional narrative is a mysterious one, and when an idea comes, the writer's sense of what a story wants to be is only vaguely visible through the penumbra of inspiration.
Beware of addictive medicines. Everything in moderation. This applies particularly to the Internet and your sofa. The physical world is ultimately the source of all inspiration. Which is to say, if all else fails: take a bike ride.