If your child gets out of bed, put him back without getting upset. Stay in the room until your child is still, then leave. Repeat this if necessary and your child will realise that you won't compromise on the sleeping arrangements. If he keeps getting out of bed, you can close the bedroom door and keep it closed for increasing amounts of time, until your child stays in bed willingly. Start off with a minute, use four intervals and increase the last interval to five minutes. If the problem persists over a number of days, then increase the closed interval until you reach 30 minutes for the last interval. Always check on your child when you open the door, but do not go inside the room. Offer praise if your child stays in bed.
Most toddlers are able to go back to sleep by themselves, using conversation with imaginary people or comfort from stuffed animals. Sometimes your child might wake up from a bad dream and need comforting. If your child is crying, check and see if there is a problem such as a dirty nappy, clothing that is irritating, blocked nose or other ailment.
Of course, if your child has had rapid development or growth, or is recovering from illness or trauma, then special attention may be needed at night until things settle down.