There have been a number of dreams I've had where I realized I'm dreaming and I don't like the dream so I try detrimental things to wake myself up. Any way, my question is, how did I realize I was a dream? I noticed that sometimes when it happens, things are a little unrealistic, but I don't notice that in the dream, so how do I do it?

Dreaming is still very poorly understood. It is important to realise that they do not occur in real times. Almost all dreams we remember when we wake up happened in their entirety at the moment we were waking up - that is why we remember them. Thus how much we remember is dependent at least in part on how suddenly we wake up and move from REM (dream) sleep through the stages to awakening. The more sudden it is the more likely you will remember more of the dream.