In Cormac McCarthy’s bleak dystopian novel The Road, a father and son wander across post-apocalyptic America avoiding all sorts of dangers and trying to survive. The father has a pistol with him and in the father’s eyes, the value of that pistol—rather than being a weapon for self-defense—is primarily as a way out, a means to commit suicide and avoid the horrors of being captured in the world they inhabit. There is justification for this, since multiple scenes in the book show and allude to captured human beings being eaten, used as slaves, and used as unwilling concubines.
The themes of the passage you have chosen are defeat, suicide and desperation. The father is handing over the pistol and telling his son in no uncertain terms that he needs to shoot himself through the head if they are found out. The father suffers no illusions that they will get out of their precarious situation gracefully. He knows that he cannot protect his son against the terrors of their horrendous world, and the last gift he can offer him is to control his own death, “quick and hard,” rather than a long, drawn out torture. It is a very heartbreaking passage, especially the phrase “You know how to do it,” which demonstrates that they have gone through this same tutorial many times before.