If you are already injured, then you should see a sports chiropractor, physical therapist, or an orthopedic doctor. And even if you aren’t injured you should still see a personal trainer or fitness expert to learn the proper exercises in order to avoid injury.
Find a gym where you can start at your current capabilities and they will take you in the direction of your goals. You should feel comfortable in your training, but you should still feel that you’re advancing.
Not every exercise is right for every person. If an exercise injured you in the past, then don’t do it again. The same goes for fitness classes. You are paying for the class. If something doesn’t feel right, then modify the move to what feels best for you.

You want to find people that encourage you emotionally and physically when working towards your goals. Also, it is much easier to see a doctor that already knows you and your body. They can give you the proper exercise advice and modifications so that you can continue your fitness journey.
Exercise should be for gaining better agility, mobility, strength, or athleticism. Leave dieting for the kitchen. Enjoy your exercise. Enjoy moving better and feeling better.