J.F.
I did this with my oldest and at 3 yrs old this is what I did...the first two nights I told her I would lay down with her until she fell asleep and if she got up in the middle of the night I would put her back in her bed immediately and lay for a few minutes rubbing her back. The 3rd and 4th night I would sit next to her bed until she fell asleep. The 5th and 6th night I sat or stood in the doorway. On the 7th night I stood in the doorway for only 5 min. This worked for me but I didn't give in to her begging to sleep with me and told her she would have to be a big girl and sleep in her own bed.
I hope this helps....good luck and stay strong.