Creating some sort of shape by turning at is Black's strongest attempt to live. White refutes it by reducing Black's eye shape with . After that, a and b are miai to limit Black to one eye.
The door group with one extra leg is unsettled. Since a move at a reduces the shape to the dead door group, it is White's killing move. Incidentally it is also one of the moves allowing Black to live. From this it is also easy to understand that the door group with two legs is unconditionally alive.
The presence of hane at the marked points helps a bit towards life for the black group, while absence of either stone helps a lot towards its death. Keeping this in mind, together with the shapes above, will help you to analyse similar situations in your games.
With a hane (), Black can live by playing a turn on the side with hane (). After , White can't connect at a. In general, to take advantage of a hane in making a life, induce the opponent to play on the point two spaces away from the hane ().
Exercises on the door group: