To be a sharp sailor or soldier, most of your uniforms should be pressed with proper Military Creases.

It's actually very easy to put proper creases in a shirt and pants. With enough starch (or polyester shirts) you can even get the creases to stay in for several washings.

Step one: Crease the spine.
Fold the shirt along the center of the back. This is best done by holding both ends of the collar to each other, and using your other hand to pinch the back side; do likewise for the bottom of the shirt, and then fold along the line from point to point. Once you've made this basic fold, shift your hand down to the seam across the shoulders- you don't want to crease above this line, or you'll look like a jacked up recruit.
Iron this fold as flat as humanly possible. The more you iron it, the better. It's usually a good idea to start by steaming the hell out of it, then apply heavy starch and iron dry. Your goal is a perfect knife edge- the thinner you manage to make it, the better. You might be surprised how flat a crease can be; if done precisely, until you unfold it you can't even tell there are two layers of fabric.

Step two: Crease the rest of the back.
If you have a Bluejacket's Manual, you can use it to set the width of the other two creases along the back. If you don't have this book (say, you don't have your sea bag with you) the width of a DVD case is about the same; or, for the perfectionist, fold each half of the back of the shirt so that the underarm seam lines up with the spine crease. Since that method is confusing to most, just make a crease identical to the spine crease one Bluejacket's width (or DVD width) away from the spine, on both left and right sides.

Step three: Crease the front.
Turn the shirt over to the front side, being careful not to wrinkle the back of the shirt. You may do either side first; for example, the left. Fold the bottonholes inward, toward the left seam of the shirt, and form a straight crease running from the bottom of the shirt, through the center of the pocket (the button should stand straight up on edge on the ironing board) to the top seam of the shirt. On Navy uniforms this crease usually runs through the manufacturer's label.
Iron as before. You will need to put extra time into the pocket if you want it to look good; extra steam might help, but really you'll want a ton of starch and a few solid minutes with a dry iron.
Same basic process for the right side.

Step four: Sleeves. Almost self explanatory: Iron the sleeves flat. Don't worry much about the seam, since it's a seam, and should have a natural crease; go over it if you have time. The top of the sleeve should be creased about as sharply as the rest of the shirt.

Step five: Iron flat areas.
This step is just as important as the creases, but often neglected. You'll want to starch two spots: along the buttonholes, and the collar. When pressing these bits, you'll want to actively stretch the fabric with your free hand while ironing it. This will prevent any slight wrinkles from magically reappearing under the iron. The rest of the shirt, which at this point is just the shoulders and the underarms, needs only be quickly ironed flat with steam or dry.

Pants are almost self explanatory, and somewhat optional. Creases should be precisely centered between the seams, and again as sharp as possible. Personally I've never managed to hold a crease in cotton pants for more than an hour of wearing, so unless you have CNTs you might want to just iron them flat. But an outstanding sailor (or marine... or soldier, I think) And there you have it. If you do it right, you'll look good and be on your way to good evaluations, leadership opportunities, and even early promotion. You may even earn a good hazing from your jealous shipmates.

Common variations and errors
A few things to consider and a few to avoid. In boot camp they issue you green Speed Stick, which until uniform issue, you suspect is for your underarms. It's really, though, an ideal starch substitute- non aerosol, compact and sea bag friendly, and easy to use. I've never tried it on working whites though- it starts out green, and I'm not very trusting. Speed sticked creases don't always look as sharp as starched, but they seem to hold up a little better in the laundry.
It is possible to do a somewhat acceptable job with merely steam, no starch. Usually this is great the second, third, and fourth time around, when the basic crease is already there; but if you find yourself a complete clutz with an iron, you may do more harm than good by burning the starch or planting a nice orange starch stain on your white shirt. If this is you, then start by starching your worst shirt, the one you never wear, and skip the starch on the others if you find you destroyed that one. Your creases will hold a little, but you'll be ironing more often than you'd like.
The one thing you absolutely want to avoid is Railroad tracks. Railroad tracks occur as a result of a double crease, and are very easy to create by mistake. If your crease is slightly off after being starched, don't try to correct it or you will make railroad tracks. It can be corrected eventually, but ask yourself if it's worth the effort. Tracks look worse (and fare worse on inspections) than a slightly off crease. If you want to redo a crease, wash the shirt, iron it flat, and then start over.

And there you have it. Oh, one last thing. There are certain items you want to avoid putting these creases in, and some you can't put them in. Navy dress uniforms, for instance- those get different creases (iron them the way you fold them...) and besides they don't open on the front. Civilian clothes, for the most part, look OK with the creases but it just won't work right on a pleated shirt. Finally, do not put military creases in your goth club gear. That's just plain creepy.