We recently went through this with our son who's nearing 3. We put him in a twin bed and he started to get up all the time.
I read on the internet to not use negative reinforcement but positive.
There was something online that says to give your child something - we used pennies. We give him THREE pennies each night. If he keeps all of them he cashes them in for 3 skittles in the morning (you can use M&Ms or whatever they like). Another lady saved them so they could do a trip to the dollar store at the end of the week. I don't worry about my son putting them in his mouth but if you child is still young, put them pennies up on a shelf she can't reach.
The thing is whenever you need to get up with them because they got up and won't stay in bed, take a penny away.
We did this ONE night with our son and he will NOT get out of bed at night anymore. He lost one penny. After that he goes to bed every night. We give him his pennies and he points to daddy and says, 'Do not take my pennies daddy!'.
We have told him he IS allowed to get out of his bed if he is poopy so he does know that.
This has helped us tremendously. We started it last week as a last ditch effort because we'd put him to bed at 9pm and he'd still be up at 11! Now he stays in bed.
Good luck!