Sleep problems are not confined to young children and worries about the dark or sleeping alone can continue well into primary and even secondary school. Getting enough exercise, turning off screens and having a routine can all be helpful. You might also like to consider relaxation CDs or Apps (see below)
For many children sleep difficulties are closely related to anxiety. It’s at bedtime, when there are no other distractions, that those worries really surface. If that starts to become a pattern, parents sometimes find it helpful to set aside some time at bedtime to talk over worries, but you might want to consider setting a time limit e.g. having 10 minutes every evening. Some children use worry dolls or might write down their worries and then put them in a box or scrunch them up and throw them away.
For older children you could try discussing choices in terms of tackling worries and then look at the pros and cons of each choice (e.g. I could do nothing, I could ask my friend what he thinks, I could ask the teacher to put me in a different group). This can help your child feel more in control. A lot of the resources in the anxiety section are really helpful here because addressing the worries is likely to lead to better sleep.
Excellent Australian Podcast about sleep in children - each episode covers different age groups and problems e.g Do primary school age children need more sleep? Find them by clicking on this link: PodCastOne:Sleep
My child has night terrors or nightmaresHow to recognise a night terror compared to a nightmare and what you can do to help. Night terrors are commonest from about 3-8 years and most children grow out of them. Although upsetting to witness, children don’t remember them and they are not usually a sign of underlying anxiety. Recurrent nightmares are often remembered and may sometimes arise from a traumatic event.
Headspace is a popular meditation App - the first few sessions are free so you can see if you like it and it has special sections on meditation for sleep and a section for children, although you have to subscribe for these.