I have committed myself to setting up a saltwater tank...and boy am I scared

I've had quite a bit of experience keeping and breeding freshwater fish, but my past experiences with saltwater were quite negative - the tanks were ugly and the corals and macroalgae did not thrive and typically died off (the fish and mobile inverts typically did fine). The fact saltwater is so expensive to set up and maintain does not help matters...I guess I am just looking for someone to tell me "you've got this!" and maybe give some advice to help ensure that happens. Thanks :)
You've got this!
But before you start, bone up your fundamentals with some heavy reading. Martin Moe's "Handbook.." is THE classic book for folks starting out. If you can read all the classic articles form Crag Bingman and Randy Holmes-Farley, they will open your eyes to what it takes to make stony corals EASY. It's a lot of reading, and I reommend reading the ones about dosing or about alkalinity and calcium more than once. I did.
Avoid most of the trendy trends in the hobby as most are experimental and have lower chances of success than what folks have been doing for decades before.
Don't rush the cycle – the natural method is still best. Don't rush anything else either. Don't chase test numbers like pH. Don't try making it a "low nutrient tank". Don't think you need to add macro algae. Don't think you need anything but a protein skimmer and live rock as the basis for the tank. It's not the only basis, but it's the simplest/most successful one.
Don't set the tank up for anything but your own purposes. If you really like corals, consider a coral only tank at first. If fish are your favorite thing, maybe consider starting with a FOWLR setup at first. If you really only like one coral or one fish,
focus on that one coral or that one fish.
Don't copy anyone else's setup unless it really is identical to what you want....and even then be careful trying to clone a mature system. Remember it wasn't born mature and probably looked and acted VERY different when it was started. (More importantly, the reefkeeper probably looked and acted different as well. Every tank is a journey.)
The list of don'ts is long when you're starting out. Stick to the basics, the fundamentals.
Once you have your "sea legs" and the tank is on cruise control, THEN you can rare back and get creative with different things....if you still see that as valuable.
And now one question: What do you see as the failings of the last tank that caused the problems for your corals? Guessing is OK if you aren't sure.