My DS is almost four, and we're in the process of gradually transitioning me out of his bed. The first step was making his room and his bed a place that he really liked and enjoyed spending time. I make a point of playing with him in his room a lot, and he picked out Winnie-the-Pooh stickers that we used to decorate the walls together. So, he now has no qualms about sleeping in his bed in his room, and every night when I ask him where he wants to sleep, he picks his bed over ours (because our room isn't "cool" like his).
Initially, DS would always say that he wanted me to sleep in his bed with him all night. I agreed for the first few nights, but each night, I told him that eventually, I would want to sleep in my own bed. Then the night came when I started saying that I would help him go to sleep in his bed, and I would sleep there with him for a little while, but that I would get up and go to my bed later. Each night, we would "negotiate" about how long I would stay in his bed - 30 minutes, 100 minutes, whatever - I would just agree to whatever he said, because all that really mattered was that he knew and accepted that I would be there initially and then move to my bed. (It helps that he totally zonks out and isn't disturbed when I get up and leave.)
DS generally wakes up once during the night, around 3-5 a.m. The first few times he woke up and I wasn't in bed with him, he yelled "Mama" pretty loudly. Now that he is getting used to waking up and being alone, he still calls out for me, but not as loudly or urgently. Our room is right across the hall, so I go to him immediately and sleep the rest of the night in his bed.
In addition to making sure he knows what to expect and knows that I will come if he calls me, I'm also working on a few things that I hope will help him sleep all night or enable him to go back to sleep on his own if he wakes. I think that part of what bothers him when he wakes during the night is that it's dark, so I'm doing little things to try to get him more comfortable with the dark. I've been asking him to turn off the light in his room and then come get in bed, as well as to get out of bed and walk to the bathroom himself if he needs to pee during the night. He's actually starting to get excited about the fact that he can find his way around in the dark, and that it really isn't so hard to see after all, and I think that's helping him to stay calmer when he wakes up at night.
The other thing I've noticed is that he relies on me being there to regulate his temperature during the course of the night, and I think he wakes up when I'm not there if he gets too hot or too cold. So I'm trying to pay more careful attention to what he's wearing to bed, what temperature his room is, whether there's a window open, what blankets he has over him, etc., so that he will be less likely to become uncomfortable and wake up. I'm also making a point of going into his room whenever I wake up during the night (which is often, due to pregnancy-related discomforts) and making sure that he has enough blankets on him.
I still love sleeping with the little guy, and I do miss him when he sleeps all night without me, but I think this is working out well for all of us.
Mom to DS1 : 11/2004 and DS2 12/2008; happy to have discovered ECing, co-sleeping, and tandem nursing during our journey together