One thing that often happens to me is I'll start a project looking forward to seeing it's completion, and then later in the project's lifetime I'll give up, scrap the project, and start a new one. This happens over and over again, and it's honestly emotionally exhausting. This is partially due to being in a loop of "this code isn't good enough", which in result can cause things like imposter syndrome, lack of motivation, and similar, a great explaination of this is a xkcd comic named Good Code.
Over my years I've learned there is ways to counteract this, and I'm going to share my methods so that other people can hopefully escape this negative-feedback loop of orphaning projects. So let's get started, first off let's think about exactly why you're doing it, it can be for many many reasons. I personally do it because I think the code isn't good enough or it seems to difficult, so let's start with those points first. There's a few things you can do to prevent you from going into a loop:
- Try not to start projects that are "over your head"
- Focus on tooling and languages you are already comfortable with
- Take breaks and don't push yourself to work on something too hard
- Try not to burn yourself out when working on something
Another important point I want to bring up is don't force yourself to work on something, I was originally the lead developer of a Discord bot framework known as Blueprint, due to getting busy and no longer having the motivation to work on it, I stepped down from my position. Don't be afraid to do things like this, if your project(s) are open source, or you're working on it in a team, don't be afraid to tell people that you need to step away. While this can't always be done in job scenarios, it is usually okay to step away at least for a minute and work on something else, and that can help you stay motivated.
One very important thing I want to note on a previous bulletpoint I made, while it's typically feels safer to stay within your comfort zone, success in something usually comes from outside the comfort zone. A video by the YouTuber pontypants made me realize this after watching it, and I highly recommend watching it yourself, for those who actually want to the specific video is here. In general it's safer and easier staying in the comfort zone, but sometimes in life, in projects, in many things in general you need to break out of your comfort zone, and try risking things and see how things go from there.
Before I end things off with this post, I want to say that you doing what you are, working on projects, looking for jobs, or whatever else you may be doing, you will get through it. You will succeed in what you're doing as long as you put the effort in to achieve it. This all being said, I wish you the best of luck and the greatest of fortunes in your endeavours.