Here are some diet and lifestyle tips that help prevent loss of bone mineral density with calcium-rich foods, vitamin D, magnesium, and so on.