Go to any health site, like the UK NHS site, and the general advice to prevent osteoporosis is to do plenty of weight-bearing exercise, eat calcium-rich foods and get enough vitamin D.
Yes to all of the above, but seriously, there’s a lot more to bone health than those three steps.