Image copyright Thinkstock

People over 50 are being advised to avoid caffeine after lunchtime to get a good night's sleep.

A report for the charity Age UK says sleeping soundly gets harder as we age but getting enough rest is important to keep mentally sharp.

It recommends older people get seven to eight hours of sleep a night and gives tips on how to achieve this.

As well as avoiding tea and coffee, older people should keep daytime naps to shorter than half an hour.

Other tips include:

Get up at the same time every day

Expose yourself to natural sunlight during the daytime

Don't drink alcohol to help you to sleep

Try to eat dinner about three hours before going to bed

Don't look at an electronic screen of any kind after you get into bed - tablet, phone, laptop, etc

Avoid using over-the-counter sleep preparations

Wear socks to keep your feet warm in bed

Don't sleep with pets in the bedroom

Avoid arguments with spouse or partner before going to bed

The report was written by the Global Council on Brain Health report - a panel of experts convened by Age UK and the American Association of Retired Persons.

Image copyright Thinkstock

As we age, our sleep patterns change, so we become more vulnerable to waking during the night and earlier in the morning.

This is important because, in the long term, poor sleep increases the risk of heart disease, obesity and diabetes, say the report authors.

James Goodwin from Age UK said: "Sleeping is something we all tend to take for granted, but we really have to wise up to the fact that getting the right amount of good sleep is crucial as we age, helping to protect us from all kinds of problems that can affect our brains as well as our bodies.

"The message is that in order to stay mentally sharp in later life - something we all care passionately about - take care of your sleep."

For those struggling with their sleep, the report says:

If you have trouble sleeping at night, but doze off in the evening in front of the TV, trying going to bed a bit earlier or get off the sofa and walk around for a bit to keep alert

If you go to bed but can't nod off, get up for a while and find another quiet place to relax until you feel sleepy enough to try going back to bed

If you worry a lot while in bed, schedule about 15 minutes each morning as your "worry time" rather than becoming stressed at night

It is worth chatting to your doctor if you have poor sleep and it is having a negative impact on your life.

Chris Stemman, from the British Coffee Association, said: "Caffeine is a stimulant and the speed at which it is metabolised in the body varies from person to person.

"If you do enjoy coffee in the afternoon but find it does affect your sleep you could also switch to decaffeinated coffee, which is another solution to consider."