Being a software engineer is a fortune in this digital age. Having an opportunity to work from the comfort of your home and getting a handsome paycheck is not only the upside. Solving the unsolved problems and giving exercise to your brain every day to stay relevant and up to date is like winning a thousand miles marathon.
Besides having all these benefits, sadly every software engineer needs to quit one day. Either the reason is personal or professional or emotional, choosing the right time to quit is actually an advantage to venture into the unventured part of life.
Just kidding... :D I am not talking about quitting the software engineering profession. I was talking about quitting to beat the imposter syndrome. Sometimes the problem just doesn't solve. You will feel like the end of the world and you can't see the road ahead. Quit that time. Quit for a day. Quit and go home, cook dinner, watch TV, relax and sleep. Let your subconscious crack the problem and hunt for solutions. The next morning wake up and take a shower.
Although this is not the direct solution to your problem, it works like magic for most people. Creativity and intelligence are fleeting states of mind. They are not there when you are tired, exhausted, and bored. If you try to solve the problem in that state, you will create a mess for yourself and your fellow programmers.
So quit. Quit every once in a while, quit when a problem doesn't solve. Quit intermittently, venture into something you never ventured before, and excel in your programming career.