I feel demotivated sometimes, too. I know the cliche' about if you do something that you love, you won't get tired of it. I think a little bit differently from this cliche'. I work on something until I feel pain (demotivation). In exercising, whether it is running or weight lifting, I have to get tired to get a full workout. This makes me stop the specific type of workout and start back to doing the specific type of workout hours or days later. That is how growth is achieved.
I view writing and drawing the same way. I write and draw, until I don't want to do it anymore (get demotivated). Once I take a good break, I come back refreshed. Advancements in my artwork and writing skills come from when I spend a lot of time at them. This temporarily tires me out artistically, until I take a break to recover.
During my job as a maintenance technician, the same rules apply. The longer I work on something, especially if I don't know much about it, the better I become at fixing it or having knowledge about it. The aftermath usually is a mental fatigue that is fixed with rest. After the rest, I can usually work on the previous task again without the same level of mental strain (demotivation).