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 atmospheric entry heating, maintaining stability during atmospheric entry, and keeping a low mass-to-drag ratio.
A craft designed for aerobraking should generally use a heat shield to protect against atmospheric 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.
For atmospheric entry to Kerbin you may also redirect an asteroid since they are excellent ablative heat shields. It is possible to use them for atmospheric entry on other planets as well but you will find that they are simply too much dead weight to be carrying around.
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 atmospheric entry 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. You can think of this as simmilar to the rule of keeping the center of thrust close to and angled behind (retrograde of) the center of mass since the heat shields is a point of impact and each generate a force, the sum of which you could consider being the exact inverse of a center of thrust. Achieving a stable design following just this rule alone may not be easy in practice however.
A reaction control system and/or reaction wheels may be necessary to help maintain stability. However since these only provide a small amount of rotational force and considering that the rotational force induced from the atmospheric drag increases as the atmospheric density increases the lower in the atmosphere you go, this means that you might find that you need more of them. And since adding more of them pushes the center of mass backwards this exercise can quickly become self-defeating and you end up making your instability problem worse. As a general rule if one reaction wheel proves insufficient, you ought to find other ways to improve stability.
An often more practical alternative to improve stability is to add atmospheric drag to the tail of your vehicle. The only parts able to survive the atmospheric entry heating is an ablative heat shield, so you can mount at least four of those at the back of your vehicle so that about 3/4 of each protrude outside of the radius of your main heat shield being exposed to the atmosphere that rushes by it. This design have several nice properties. First of it is a self-stabilising design since any part of it that gets pushed into the hot plasma by rotational forces will add more drag to that side of the vehicle thus adding an opposite force cancelling the motion out. Second, the amount of force on the tail is also directly proportional to the force on your front main heat shield which both increase in magnitude as you descend down the atmosphere. Third, extra drag is always a nice bonus when you're trying to aerobrake.
If you need an even more stable design, you can angle the tail heat shields just ever so slightly outwards, about 6° will direct 10% of the drag force into additional rotational force. You can also increase the amount of, or size of the tail heat shields for more tail-drag. As a general rule you should have as much (or more) exposed area on the tail heat shields as your have on your main front heat shield(s).
A tail heat shield rig that gets too large in terms of area may also start to twist when exposed to braking forces which will alter its aerodynamics and could rip your vehicle apart. Testing using one 10m inflatable heat shield in front showed that a few adjustments was needed to stabilize the design: Reducing the number of tail mounted heat shields to 3x 10m inflatable heat shields. Keeping the angle 0° prograde. And lastly adding 3x2 diagonal struts.
In case you're wondering about the feasibility of trading some drag for increased deflection in the hopes of reducing the tail mass. Tests done show that with an excessive angle of 45″ on the tail heat shields did in fact increase perpendicular forces, however the resulting configuration appears to be unstable, at least with the 10m inflatable frontal heat shield that has an annoying flipping tendency.
Using many or large tail heat shields also makes your vehicle tail heavy with all the aerodynamic implications that follows from that, so if you're planning to land on the planet in question you may want to to jettison or decouple the heat shields some time after the atmospheric entry plasma wears off.
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 atmospheric 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. A plane landing on the runway is an example of safe lithobraking.
The only sensible place to lithobrake from orbit, without first aerobraking or slowing down in other ways, 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.