Number one, cleanliness, this is the most important. No comedy ones over 30 and stick to white, it looks better for longer. Coloured and patterned ones fade quickly, ribbed holds its shape better and for longer.
You have three choices - Trunk, Boxer, Brief. No string, no thong, no tanga, nothing whatsoever that you may find in Peter Stringfellow's knicker drawer.
Suit your body shape. If you are a large man don't wear a tiny pant, looking good is always about proportions.
Those ironic Y-fronts should be ironic, make sure you can carry it off.
Keep your underwear subtle, logo/designer pants are very popular but remember you are not an unpaid billboard.
No holes and definitely no tired looking elastic.
Ask yourself before you put them on, "Would you want anybody to see you in these?" If the answer is no, bin them.
Boxers should be ironed, if you are not going to iron them then don't wear them.
Find out which ones you like and which ones suit you and then buy lots of them, it is good to have the same type of underwear. You look better for it and less for you to think about in the morning.
If you don't want to spend lots of money on underwear, then go simple, don't try any of the looky-likey cheaper designer copies, just stick to simple basics.
Replenish little and often.
Underwear should make you feel attractive, if they don't, then explore other options.
Read when TheChicGeek took The Figleaves 7 Day Underwear Challenge