Check with your core muscle strength first i.e. back and abdominal muscles. If they are still weak, start with core strengthening (Mat exercises).
In Gym, you can start with weight training but avoid direct forward bending ( bend through Knees) & make sure you are not straining your back muscles.
Next Steps
Core Muscle Strengthening exercises on Mat
Health Tips
Avoid direct forward bending.
While doing Leg press in gym, when you're releasing weight, make sure that it's gradual movement.