Aerobraking is a technique for reducing velocity relative to a celestial body through the controlled use of atmospheric drag. An aerocapture is a special form of aerobraking which is used to go from an escape velocity into an orbit instead of adjusting an already stable orbit. Aerobraking is a dangerous and difficult maneuver which involves intentionally placing the craft very close astronomy-wise to the surface of a body.
When a craft enters the sphere of influence (SOI) of an orbiting celestial body, its relative speed will be much too high to be captured by that body and without intervention it will simply fly out the other side of the target's SOI and return to orbiting whichever body it was previously in the SOI of. To reduce velocity and be captured into an orbit, the craft can either fire its engines retrograde, perform a gravity assist around a moon if present, or, if the target body has an atmosphere, perform an aerocapture.
The main challenges of designing a vehicle to aerobrake consist of managing re-entry heating, maintaining stability during re-entry, and keeping a low mass-to-drag ratio.
A craft designed for aerobraking should generally use a heat shield to protect against re-entry heating, especially when moving at high speeds and plunging deep enough into an atmosphere to get significant drag. A single heat shield usually has more than enough ablator for typical purposes, and the ablator does a good job of carrying away heat by itself, making other heat-managing systems generally unnecessary. A fairing to protect the components behind the heat shield is strongly recommended if atmospheric turns and maneuvers are expected during aerobraking, especially for longer vehicles. However, as long as all of the ship's components lie behind the heat shield and as long as the craft generally faces close to prograde while aerobraking, a fairing is not required.
As with other air vehicles, aerobraking vehicles are at risk of becoming unstable and flipping in flight. During an aerobraking maneuver, this can expose the unshielded side of the craft to immense reentry heat, leading to rapid catastrophic failure. To maximize stability, try to keep the center of mass as far forward as possible. Use a shorter design where possible. A reaction control system and/or reaction wheels may also be necessary to help maintain stability.
This determines how quickly a craft will slow down when aerobraking. Due to the changes in aerodynamics in version 1.0, aerobraking is now generally harder to accomplish since vehicles do not slow down as easily. To slow down effectively, aerobraking vehicles now generally need to be lightweight while maintaining a large surface for drag. Under some circumstances, it may be worthwhile to use a heat shield with a larger radial size than the rest of the craft to lower the mass-to-drag ratio and thereby allow for more rapid deceleration.
Note that navigating a craft with a very low mass-to-drag ratio deep into the atmosphere of a planet creates the risk that the vehicle will slow down too much to be able to return to orbit. This may result in the vehicle descending to the planet's surface due to losing too much velocity to return to orbit. To avoid this, recall that the chief advantage of a low mass-to-drag ratio is that the vehicle can slow down more effectively while remaining higher up in the planet's atmosphere, creating somewhat less risk of an unplanned descent.
To perform an aerobraking maneuver, the trajectory of a craft is altered to pass through the body's atmosphere without impacting the surface. If properly navigated, the atmospheric drag will slow the craft down enough to turn its escape trajectory into an eccentric orbit. After the apoapsis is lowered to the desired height, it will be necessary to raise the periapsis once back outside the atmosphere to stop losing altitude on subsequent orbits.
In games with quicksave activated, the period prior to entering the planet's atmosphere is a good time to make a quick save, since it's usually difficult to predict exactly how low you must set your periapsis in the planet's atmosphere to achieve desired results. Aim too low and the vehicle will most likely become too slow to return to orbit. Aim too high and the vehicle may not slow down enough to be captured by the planet. Ideally, the vehicle will be slowed down just enough to remain in the planet's SOI, with its apoapsis above the desired final apoapsis. This will leave the periapsis in the planet's atmosphere, and it can be adjusted with minimal fuel once the craft returns to the apoapsis. As soon as you've achieved an orbit around the destination planet, it becomes trivially easy to make repeated cautious passes through the planet's upper atmosphere to gradually bring your apoapsis down to the desired height.
Note that the stock game does not modify predicted trajectories to compensate for aerodynamic drag until that drag happens in real time. Because of this, it is very hard to plan maneuver nodes for aerobraking on the map ahead of time without using mods.
For the ideal height for an aerobraking maneuver, consult the article about that body. The following planets and moons have atmospheres that allow for aerobraking:
In real world space operations, an aerocapture is a maneuver intended to enter an orbit around a target body, while aerobraking refers to lowering the apoapsis of an existing orbit. However, the terms are generally used interchangeably in Kerbal Space Program. Additionally, in real life aerobraking maneuvers are planned to be extremely conservative and a craft will typically perform many passes at a height at which the atmosphere is very thin, losing small amounts of velocity each time while avoiding the effects of turbulence and frictional heating.
In real life, the Mars Climate Orbiter miscalculated its aerobraking trajectory and crashed into Mars in 1999. The Genesis mission failed to deploy a drogue on re-entry and crashed into North America in 2004.
Lithobraking is a semi-serious term used to refer to a spacecraft being slowed by contact with the ground. Lithobraking at too high a speed will cause a catastrophic failure of the mission, but it can be used as a low-delta-v landing technique. A lithobraking vehicle can non-destructively roll or skid and use friction over a considerable distance in order to dissipate excess kinetic energy relative to the body being landed on, or a portion of the spacecraft can be sacrificed with the energy of landing absorbed by components breaking.
The only sensible place to lithobrake as a serious method is the flats on Minmus. They are perfectly flat allowing a craft with landing gear to land and slow down under brakes. The aircraft landing gear are needed otherwise the wheels break due to excessive force. To execute this maneuver the player should start in a low Minmus orbit the lower the periapsis to just below the surface in the centre of one of the flats. Proof-of-concept lithobraking has been carried out successfully, without retro-rockets or parachutes, on both the Mun and Kerbin.