I agree with Meric - it's mostly about fighting the inner Deamons. At first one deamon feeds you with doubt: "oh, you are such a pathetic piece of shit, you're a bad programmer, bad worker, you don't know enough", and then, when you want to change, another deamon: "oh you can't change, you are weak, you are too stupid" and "you have the mortgage, wife, your children's education". And then you start to hate yourself and have suicidal thoughts because the deamons make your life miserable. Meric is right in that you really don't have to do anything or be anything. You are not your work, and you are not your family. You can divorce, change jobs, change places, and you are allowed to fail.
Most importantly: you are the most precious person to yourself, love this guy.
Try maybe to realise that your existencial fears come from all past failures and dangerous situations, your limbic system just attacks you with the scarry visions, because this is what it evolved for: "see the tiger, recognize threat, run!" You could then do it like Zen buddhists: "I see the feeling coming, I look at it, I observe it, I know where it comes from, and I gracefully let it go".