Maintaining a healthy diet rich in calcium and vitamin D, engaging in regular weight-bearing exercise, and avoiding smoking and excessive alcohol consumption may help prevent osteoporosis.