It is essential for who ever you are writing for to have a good knowledge of your audience and have a target age in mind.
When writing for children remembering back to your own childhood is a starting point but you must keep in mind the modern child in today’s technology filled world. This does not mean every child in your book needs their own mobile phone or games console. In fact it is often better for tension if they are unable to call for help at a touch of the screen.
The best way to find out about your audience if you are writing for children is to observe them. Not in a stalkerish, creepy kind of way. If you have children, or have friends and relatives with children talk to them, find out what is going on in their lives. Ask about their likes and dislikes. Find out what books they love to read and their favourite characters. If you don’t have children talk to friends who have, or talk to your local children’s librarian.
Another good way to find out about children today is by watching children’s movies and television. Immerse yourself in the adventures, problems and emotions of the characters. They are likely to defy authority and will be outspoken with their own strong opinions. This may vary in intensity for reception, junior and secondary aged children but there should be a degree of independence.