It takes long time of practice. And luck maybe. As far as I know, keeping a dream diary will help. Also, form a habit like counting your fingers two times to tell reality from dreaming, until you can do this in your dreams, in which you can notice something about your fingers is wrong. It's like those small objects in The Inception. Though these are all just theories. I never succeeded myself:(
This normally happens when one starts to remember his or her ordinary dreams and keeping them on a journal. Some of the ordinary dreams will have objects or people featured and they could act as an indication for one to wake up in his or her dreams.