Under 10 miles a hardtail/fork mountain bike w/1.75 or 1.50 street tires. Assuming you ride on roads. It you don't want to upgrade to Schwalbe Marathon Plus tires because of the expense use brown Mr. Tuffy tireliners. Don't bother with a suspension fork. They're heavy and unnecessary for commuting. The tires provide plenty of cushion.
10 miles+: drop-bar cyclo-cross or straight bar hybrid. A cyclo-cross while resembling a road bike are usually a more stout frame/wheelset as they're made for off-road cycling. 28-35mm tires. Keeps rolling resistance low and plenty of comfort. The more narrow the more speed potential. Desirable for longer distances. Use red Mr. Tuffy tire liners. Depending on terrain limit front cranks to a double. Unless absolutely necessary avoid a triple crankset. Trust me in this. New bike or used depends on your budget and bike savvy.
No matter what type of bike fits your need the following is basic commuting equipment for either:
Rack, full coverage fenders, 5w rear blinkie, 150 lumens headlight w/strobe option, trunkbag or small panniers, extra tube, metal tire levers(plastic are useless), multi-tool, patchkit, rain poncho, helmet, goggles, frame pump. Your kit can be added to or subtracted from depending on need.
My commuting experience is more than 25 years. I practice what I preach. ALL my bikes are set up as commuters or utility bikes. Except my fixed-gear. And even it has a seat post rack/trunkbag. Pretty hardcore. Year-round. Have studded tires for winter. lol Obviously, I live car-free. Mostly, find a bike you like and RIDE it. Everything else is secondary.