In the last few years I have been widowed (fairly young) and then had to stop work to look after elderly parents. When my parents died, I found that I didn’t really know anyone in my local area so had to put some effort in if I wasn’t going to be lonely.
You need to find activities where you are forced to interact with the other participants as part of the hobby. Fitness classes don’t tend to do that.
For example: Book Club, Tennis/Badminton, Choir, Ramblers, Dance (think modern jive where they pair you up with someone when you are there) etc. Pick something you will enjoy even if you don’t make friends straight away.
It will take regularly turning up for a while before you can then suggest a coffee/ drink after the activity (if no-one else does) and you will slowly get to know the other members.
After a while, suggest a related activity, e.g. ask if book club members want to see the film of the book with you (even if it’s on video at your house with a bottle of wine) or a visit to an area the author lived in or wrote about or else an activity that you have discovered the other members like that you also like (e.g. walking).
Ask the other members what other groups they get involved in, they may offer to take you along or suggest activities to try.
Many groups also do weekends away as part of the activity.
It won’t happen overnight but you will get there. If you decide to go back to dating it will give you something to talk about and make you a more interesting person.
Just get out there and keep at it, treat it like a job until it works for you, it will eventually.