The solution is to capture at . Now a and b are miai for life.
The connection at is a failure, because after , Black has only one eye.
Directly preventing the stone from connecting is also a mistake. After , Black dies with a nakade.
If here, sets up a ko which Black must win in order to live. Since Black can live unconditionally, this is not the best result. ( at a is killed similarly to Failure 2 above)