Good diet and weight bearing exercise are certainly the most important things (along with ensuring good levels of vitamin D, which is not really possible from diet alone, as it is mainly produced by the body itself from sun exposure) - but bear in mind this needs to be a lifelong approach, as you reach peak bone density at quite a young age, which will only be a good peak bone density if you did this all through childhood and your teenage years, and early adulthood - without ever over-doing it, because over-training is also a risk factor for osteoporosis in female athletes. Everyone starts to lose bone density in their 30s, regardless, and at least half of women over 50 end up with osteoporosis, often only something they realise when they fall and break a wrist, or break their hip, or start getting shorter and having back pain.
Very unhelpfully, a lot of the advice for women around pelvic floor issues like prolapse is that things like running, lifting heavy weights, jumping, etc, can exacerbate the problems, so they are instantly confronted by conflicting advice - both do and don’t do too much weight bearing exercise… or, would you rather your internal organs fell out of your vagina, or that your spine crumbled? Doctors simply don’t bother, or know, how to advise women properly on how to protect both their pelvic floor and their skeleton at the same time (and, eg, hypermobility has been linked to increased likelihood of both osteoporosis and prolapse, so it’s harder for some women than others!).
And then, of course, no-one can really help being severely asthmatic, or having rheumatoid arthritis, or cancer, or crohn’s disease, or coeliac’s disease, or any of the other things that can increase the likelihood of osteoporosis. Nobody can help their genes. If you are caucasian and have a small frame, you can’t change that.