Hello AwakeAtNight, welcome to the forums! The second part I believe was a WBTB, but the first part was DILD (Dream induced lucid dream). There are many methods and techniques to gaining lucidity, that is what this forum is about after all. You can take a gander at the tutorials section which provides in-depth methods and explanations for various ways to have lucid dreams! It appears you already have had a DILD, so you could read through that tutorial to better inform yourself, or perhaps take a look at the WBTB or MILD methods. These are the basic methods, though you can always try some alternations that have been created.

A lot of newbies to Lucid Dreaming like to attempt the WILD (myself included) at first, just as a heads up you should avoid this method until you are quite experienced with lucid dreaming. Although it is effective and provides longer more vivid lucid dreams, it is extremely difficult to learn. '

Anyway, hope my post isn't too confusing. If it was, sorry, just go to tutorials and look up the DILD,WBTB, or MILD tutorials and you should be well on your way. Any more questions? Throw 'em at us and we will do our best to help out!