How do I get my child to stay in bed?

Be consistent. . Limit setting issues around bed are very common and manifest by "curtain calls" where your child keeps leaving the room. Every time they leave the room bring them back to bed with a minimum of fuss. If your child is not in bed, close the door for one minute. If they are not in bed, close for two minutes. Keep doing this, increasing the interval, until they get the message.
Change the emphasis. Kids often migrate to their parents bed causing loss of sleep for all. I would change your focus to keeping them in their room.They can sleep on the floor or bed, whatever.I let them keep their door open if they stay in their room& close it if they don't.Explore scary issues & resolve them but be firm.Give them a big boy/girl reputation to live up to but return them each time.