I've been on both side of the issue. So either way you do it, no cotton as the previous post says.
For years I just wore a synthetic sports underwear with loose fitting hiking shorts. I've even done a couple 100 milers in them.
I now pretty much wear bike shorts, with no underwear. Underwear just gives more seams to potentially chafe you. However when I get out of the cycling habit and put on weight, I note two things.
1) bike shorts are really uncomfortable when I have a beer gut.
2) Sizing charts for the various brands don't work when I'm fat with love handles. I need to buy a couple sizes larger or perhaps try full bibs. But I'm too cheap, so I go back to sports underwear and hiking shorts till I get my weight down.