I lose confidence pretty quickly, but I find that just talking to someone about it, regaining your sense of self worth helps getting back into the writing state. But, when you force yourself to keep writing into something you don't want, you begin to grow disgusted with your own story and just feel like stopping. (Kinda the reason why my most popular novel is on hiatus despite being, well, popular.) Just take your time with writing, have an idea of the story before hand, and if you write on a daily basis and post as soon as possible, keep notes and tabs on what you like to see, what your readers like, and what about your story gives you inspiration. I like playing with the psychological elements in writing, so when I lose inspiration I play games of maniacs and depressants, I watch shows of similar minds where people lose their sanity and fall into the pits of despair. Take notes from life, and put them in your writing. Every story told is just a twisted version of what we have already seen. And if you feel like a story must end, end it. There are plenty for ideas to write upon. Eventually, you have to let go.