How do I get a six-pack?

You eat less food to reduce body fat. There will be abdominal muscles under the fat, and adding some muscle to this area (resistance training) can make them appear more aesthetic; fat loss is the main predictor, however

Six-packs; a function of both low body fat and high muscular density

The role of low body fat

The display of abs is more of a function of low bodyfat than anything else. You cannot reduce the fat around your belly without reducing overall fat.[1][2] Attempts should be made to reduce body fat in general, and fat located on the core will generally be lost in proportion to the rest of the body.

At very low body fat levels, a six-pack will almost always be visible. However, without adequate muscle density on the core this six-pack will look somewhat emaciated and reminiscent of skin covering chicken wire.

The role of muscular density

Like any skeletal muscle, the muscles that comprise the abs (rectus abdominus, serratus anterior, obliques, etc.) respond to stimuli and damage and grow in response to said stimuli; given adequate nutrition and repair is given.

The larger the core muscularity, the more likely it is to see the outlines of the highly sought after 'six-pack'. However, until body fat is lost any six-pack at higher body fat levels will appear blurry or otherwise soft.

Quickly:

You eat less food to reduce body fat. There will be abdominal muscles under the fat, and adding some muscle to this area (resistance training) can make them appear more aesthetic; fat loss is the main predictor, however