For framing (softwood) lumber, you want to find a local lumberyard. Their prices will be more competitive than you expect (my local supplier is about 5% cheaper than Home Depot!), but what you're really going there for is the night and day difference in quality - boards that are supposed to be straight will actually be straight! Their hours are usually not convenient for a DIY-er (8-5 M-F, _maybe_ 8-noon on Saturday), but they'll usually deliver for free or a reasonable fee, and these days most of them will do business over email.
For hardwoods, you want to find a hardwood lumber supplier. These are pretty narrowly targeted at woodworkers, furniture makers, and cabinet makers, and don't sell much besides hardwoods and cabinet-grade plywood - you wouldn't even buy a 2x4 at these places. But they'll carry species and sizes of wood that neither a big box store or a normal lumberyard carry - you want some 4/4 wormy maple to build a tabletop out of? They'll be the only ones that have it.
As for finding these places, the best thing to do is just do some googling and ask your friends/family/coworkers. These places don't advertise much so it's not particularly obvious to a beginner how to find them or that they even exist.