My family having history of osteoporosis, knee pain, back pain, Joint pain I'm 28years and I worried I get bone pain when getting older how to prevent?!

Prevention. Keep your weight down, good posture, and stay fit with a comprehensive stretching and strengthening program for the rest of your life.
Preventing soft bone. Bones are a living changing structure and respond to stress. Stress them to keep them strong. The answer is simple and often not followed: exercise daily if possible, minimum 3x a week on land at you EHR of 70-75% of you MHR-about 135-145 ppm for 30"+++ if you doc allows.Golf is ok only if you walk, walk, jog, dance, tennis, soccer and many more. Don't waste $ on Calcium pills. Vitamin D is good.