It's always a pity when someone contemplates giving up something that they enjoy for external reasons.
Fear, anxiety, call it what you will prevents a lot of people from achieving their potential.
To my mind, the best thing to do is to address that fear, that anxiety.
Close passes can be terrifying. I have three tools in my toolkit for them.
Firstly, nobody else on the road (except me, of course

) is sane and rational. By treating every other road user as an idiot I react accordingly.
The second is a mirror so I'm not taken by surprise.
And the third is to leave my testicles at home. I'm not going to stand my ground if it's dangerous or just plain uncomfortable. If that car behind me isn't giving me enough space I'll pull over.
Road craft, or basic cycling skills can't be underestimated for giving confidence. Yes, riding a bike is a simple thing, but being safe on a bike is a tad more complicated involving awareness of the road, conditions and traffic. There are many resources online for these, text and video. Cycling, if possible, in traffic free areas can build up skills and confidence such as being able to look behind and not veer off course.
A well set up bike is important too. It should do what you want it to do when you need to do it. Most of the time you may get away with it, at a critical point? That's when things go wrong.
Sometimes, it helps to ride in groups. You may have difficulty roping in some friends after this escapade, but can you make contact with other people on bikes?
A good route always helps. Sometimes the most direct route isn't the best for cycling, sometimes a route that is pleasant at noon is hell at 5. One road may have a shoulder but may be full of crap and traffic, perhaps that road without the shoulder is actually safer and more pleasant to ride?
https://cycle.travel/ works in your part of the world.
I've seen suggestions that cyclists use a pool noodle (foam) attached perpindicular to the bike to encourage traffic to give a wider berth.
Similarly, I've seen people advocate a vest/jacket or similar with "Grandpa to ...." as a way of "humanising" a cyclist. (A little part of me died, writing that).
I hope you recover fully and that maybe there's a few things in here that will help you get back on the bike.
Good luck!