For me the following were useful:
-I worked with a 'life coach', and I guess we did something like CBT. I'd be a bit embarrassed to tell my friends but it was very useful.
-Working at a company, as an employee, I slowly got the trust and respect of my colleagues. Not having co-workers must be one of the hardest parts of freelancing. Even if I'm not happy with my performance on a task, I know my boss knows I'm usually effective, and that does help me remember that too. Maybe if you worked in a group with other freelancers instead of alone, it would be easier?
-I got into a very good relationship. That means that my work is only part of what I care about, so if it's going badly, then it's not all of me.
More generally, if you are struggling a bit, there are probably things in your life that would legitimately cause anyone stress.
Maybe you are taking on full stack projects, but are only comfortable with (front)(back) end work. Maybe your under pressure from your family to make money. Maybe you are having trouble learning the business side of things, while coding at the same time.
Either way, if you can work out what those are, and avoid them, it'll give you more energy to deal with everything else.
Sometimes though, you need make a big change, sacrifice something. I didn't carry on in academia after the masters where I struggled, and went back to programming instead. It seemed like I was giving up on my future at the time, but it's very easy to come up with a new vision of your future. It's much harder to struggle towards one from a bad place. Could it be worth being an employee for a bit, then going back to freelancing when you are more confident? Or going back to school for a bit (there is always funding)?
Those would be pretty radical - you've built a business, and you'd lose a lot of it by putting it on pause. But in HN terms, if what you are doing isn't working for you, pivot till it does...?