We're told to let the child cry, and eventually, he will cry himself to sleep. I understand and agree that, of course, if the parent goes back into the room at any point while the child is crying, the child may well learn that, as long as he cries for
long enough, at some point, the parent will come back.
However, the idea of my child crying himself to sleep was one I really wasn't comfortable with. So, here's something that worked for me, and may work for others:
When it's time to go to sleep, switch out the lights and stand next to the bed (don't sit on the bed - this can be too cosy to extricate yourself from
)
Then, speaking in a gentle, quiet and dreamy voice, tell him to close his eyes, and lie very still. Tell him to relax his whole body so that he can hardly feel it.
Then pick something he loves - with my son it was dragons. So, using that example, tell him he is riding on the back of his pet dragon high above the ground. Then ask him questions (still in your "dreamy" voice)
* What colour is the dragon?
* What can he see from so high up?
* How does it feel to be riding a dragon?
* What does the dragon's skin feel like?
* Is he sitting in a saddle, or is he riding bareback?
... and so on.
Once he has answered all the questions, and you can tell he is into the experience, tell him you're going to leave him to enjoy the rest of his ride, and that you are looking forward to hearing about it in the morning. Knowing you want to hear about it in the morning can help to focus his mind even more on the details as he'll be making mental notes to tell you in the morning. He should then drift happily off to sleep, and will probably have forgotten about it by morning 
If he snaps out of it and cries when you leave the room, still don't go back - you can now leave him, knowing that you have given him a wonderful tool he can use to help to distract himself, and to help himself get to sleep - when he is ready to give up on the crying, he has something he can go to that will be, not only positive and comforting, but a wonderful and fun experience.
If it's a girl, of course use something she enjoys - maybe a pony with wings, or an angel, or a giant marshmallow, or.....
It must be something floaty and to which a lot of detail can be added - colour, texture, motion, and sights.
Hope this helps 