August 15, 2020 | 5:49pm

Remember — or at least, if you want to be able to do so when you’re older — get a good night’s sleep, a new study urges.

Most of us know about the dangers of not getting enough shut eye — obesity, heart disease and diabetes — but now researchers in California have found that poor sleep wreaks havoc with your memory, too, the Sunday Times of London reports.

A good night’s rest — from six to nine hours a night — protects old memories and reinforces new ones, according to the study, published this month in the journal eLife.

Without enough shut eye, the new memories can “erase” the old ones.

“We learn many new things on a daily basis and those memories compete with old memories,” explained lead author Maksim Bazhenov, a professor at the University of California San Diego’s School of Medicine.