While Steve's answer is the simplest way, if we're talking about
breaking a habit, as opposed to not starting a habit, that's going to be a little harder
The only way to do it is to just do it. Tell the little guy that he's a big boy, and that big boys sleep in their own beds at night. Even if you don't think he understands you, tell him anyway. Then, tuck him in bed, and every time he gets up to come in your room, put him back in bed. If you have a gate you can put at his door, that's great too. Every time he wakes up and hollers for you or comes in your room, put him back in his bed. Keep it subdued & simple, just give him a kiss and maybe a quick "big boys sleep in their own beds", and tuck him in. Keep conversation (and even eye contact!) to a minimum, and no negotiations!
Those first few nights of doing this will be very, very hard. There will probably be lots of crying, lots of tantrums, but eventually, he'll get it. Consistancy is the KEY to this though, if you've decided the time has come for him to sleep in his own bed, you've got to stick to your guns and keep putting him back there. Every time.