The reason I ask is mainly because keeping up the motivation to write depends on your goals. If you want to publish, then you need to write and write and write. You need to catch a bad case of graphomania. Write that word on your hand lest you forget it. It’s not so much to generate quantity over quality, but to develop a habit and get lots of practice writing and building the craft. One of the ways to do this, is to embrace rejection as a goal. Your job then, rather than to generate high polish stories, is to get them into envelopes. I’m not saying you need to be slapdash about it, but it takes the emphasis and pressure off of you a little. When your concern shifts from writing well but not enough to develop, to writing much and developing over time, then you’ll start to hit a stride.
If you’re writing for yourself, but can’t be motivated: Fuck it. Not worth your time. Okay, maybe that’s harsh, but you at least need to reevaluate exactly why you’re writing. If well and truly is for you yourself, internally, then you should derive satisfaction from the act itself. If it’s drudgery… then why are you suffering?
The problem with adults is that we’re terrible at motivation because we’re egotistical fuckwads. Everything we produce is a referendum on our abilities and a reason to suspect we’ll never be good at anything. Children have the right idea. An eight year old dribbling a basketball for the first time sucks. They know they suck. They just don’t care. They dribble the basketball because its fun, and they keep doing it because it’s fun until they get better at it. Adults get frustrated quickly because the novelty of activities wears off a lot quicker and all we can think about is how we’re not better at it. This is why you need to short circuit any thoughts that are keeping you from being prolific and getting into a habit. If concerns about quality are bogging you down, emphasize quantity. Remember that any draft you write is rewriteable.
Also, you need to believe in your work, to some extent. Juno Diaz is one of my favorite writers, and he spent ten years on The Brief and Wondrous Life of Oscar Wao. It vexed him, and it frustrated him, he wanted to throw it out a number of times but he kept going back to it because he felt the core of the novel was good. He believed in it. So my advice is to write like writing itself is the only goal. Get a clicky keyboard that makes you listen to your own cadence, write drivel every day for a year, do whatever it takes to develop a habit of it and get past the chore. What I found works for me is writing it like a script. Often I don’t have a problem writing, but getting my characters to do things interesting. I have problems with endings. I find I’m very fluent when I write about what a character’s backstory is, and what their motivation is, and how they got there. So I started writing these “how s/he got here” scripts and realized I’ve outlined complete stories worth writing resolving my problems finding my way through a plot, and it gets my fingers moving and my juices flowing.
Grain of salt bit: I’m only telling you what has been working for me extremely well since last Thursday, and better than anything else I’ve tried. TL;DR: Extrinsic motivation sucks. Tie your ego up in the act of writing (not writing well) and you’ll find yourself wanting to do it more.