Habit formation is the process by which new behaviors become automatic. If you instinctively reach for a cigarette the moment you wake up in the morning, you have a habit. By the same token, if you feel inclined to lace up your running shoes and hit the streets as soon as you get home, you've acquired a habit.
Quite simply, cognition refers to thinking. There are the obvious applications of conscious reasoning—doing taxes, playing chess, deconstructing Macbeth—but thought takes many subtler forms, such as interpreting sensory input, guiding physical actions, and empathizing with others.