Writing hack to defeat the doubt

How do you stay engaged when the process isn't fun? How do you keep the faith when you feel like everything you write is shit?