Lots of good advice here, but I'm going to give sort of a short-cut bit: buy a module, or a dungeon crawl, pre-written. If you're into 5e D&D, Tales From The Yawning Portal has some good and some bad dungeons in it, but I would rate Sunless Citadel as an excellent one, and I think the Against the Giants campaign arc it provides in 3-4 dungeons has very good examples of how to design dungeons that serve a few purposes. I also have a soft spot in my heart for White Plume Mountain, since it was one of the first dungeons I read when I was first getting into D&D, back in 1e/2e times.

Tomb of Annihilation has been a campaign module I've been very pleased with as I've been running it, though the hex crawl is not the best-done. You'll probably want to ask around for advice on how to better balance the exploration aspect than I did. My players spent forever in-game traveling (as well as lots of real sessions), and seemed to steamroll everything with no fear of the wilderness at all and no shortage of resources that I could justify based on the prep they did.

They're under-leveled for the eponymous tomb, but we'll see how that goes. The design of the Fane and the Tomb, as well as various site-based dungeons during the hex crawl portion, are all pretty good in my opinion, and might give you ideas for your own designs.