Our bones are constantly being remodeled.

At night, when we’re asleep, the fixer-upper cells in our bones go to work.

Special bone cells called osteocytes regulate the body’s calcium levels, repair microscopic bone cracks, and heal fractures. These project-management cells direct the remodeling process. They signal cells called osteoclasts to remove minerals from the bones when the body’s calcium levels dip too low. They also send messages to bone-building cells called osteoblasts when cracks and breaks need repair.

Much of this activity happens overnight and into the early morning hours when we are supposed to be asleep.

But most people don’t get the recommended 7 to 8 hours of sleep a night that their bodies need.

Loss of sleep gives bones a one-two-three punch.

Our magnificent bodies were designed to rebuild and repair themselves during nighttime rest. When this repair cycle is interrupted or shortened, it affects every system in the body, including our bones.

• Lack of sleep can raise cortisol levels during waking hours. When this occurs, the body tries to regulate this stress hormone by leaching precious calcium and other minerals from the bones.

• Sleeping too little also interferes with bone development. According to a study by the Medical College of Wisconsin, chronic sleep loss stops the development of bone cells and the soft spongy marrow inside needed for flexibility and fracture prevention.

• Sleep deprivation may also increase inflammation that intensifies pain in sore joints.

These conditions can spell life-altering fractures for postmenopausal women.

When it comes to sleep, older women need to remember Goldilocks.

Not too much. Not too little. Postmenopausal women need just the right amount of sleep for the best bone health.

A study of the sleep cycles and bone growth showed that sleeping more than eight hours a day led to a 22 percent higher risk of osteoporosis. Less than five hours of sleep a night also proves detrimental to bone health.

But it can be challenging for postmenopausal women to stay in the sweet spot between five and eight hours.

One reason sleep is more difficult for older people is low melatonin levels. As people age, the body produces less melatonin. Not only does this hormone help people sleep, but it also promotes mineralization and the formation of bone-building cells.

Low levels of melatonin also may affect normal sleep and wake cycles. As a study published in the medical journal Metabolism discovered, this also may be a factor in bone health. The study found that bone cells have their own internal clock that correlates with traditional sleeping patterns.

But how can you get a good night’s sleep?

Here are a few practical tips you can use to sleep better.

Create a sleep routine. Go to bed and wake up at the same times every day, even on the weekends.

Wind down with a cup of chamomile tea. Chamomile teas induce sleep.

Take magnesium, vitamin D, calcium, and melatonin. Talk to your primary care provider before taking supplements, but if you can take them, it may be a win-win. They can help you get more shuteye and give your body the building blocks it needs to create stronger bones.

Magnesium helps your muscles and nervous system relax. It also boosts the effects of melatonin and helps your body absorb vitamin D and calcium. Ask your health care provider about the correct dosage for you.

Turn off the screens. Shut off your cell phone, computer, and television at least an hour before you’re ready to turn out the light. The blue glow from these screens interrupts melatonin secretion. If you must work late in front of a computer, use blue-light blocking glasses to reduce the impact.

Use the hour before bed to write in a journal. Sometimes putting the cares and thoughts of your day on paper frees your mind and helps you sleep.

Use light-blocking blinds or curtains to keep light from coming into the bedroom from a yard or streetlight.

Add bone broth to your diet. Bone broth has glycine, which promotes relaxation and deeper restorative sleep.

Skip the late-night snack. Stop eating at least three hours before bedtime. This will reduce blood sugar spikes that can wake you up in the middle of the night.

Avoid drinking alcohol. A drink in the evening can lower more than your inhibitions. It lowers bone mineral density and interrupts your sleep if you imbibe too close to bedtime.

Lose the extra pounds. Losing weight can reduce your risk of sleep apnea, which interferes with a good night’s sleep. A Taiwanese study found that people with sleep apnea are 2.7 times more likely to have osteoporosis.

Avoid shift work if possible. Not only does shift work leave people chronically tired, but it also interferes with bone metabolism and remodeling.

Practicing good sleep habits may help keep your bones strong.

If you can’t sleep or can’t stay asleep and it is causing you anxiety or other problems, contact your health care provider. They may suggest a sleep study to find the best course of treatment to get your sleep habits back on track.