What is the best way to make sure it lasts as long as possible without replacing it
Use any of the well known brands of non-setting underbody protection. Everyone has their personal favorite (Dinitrol products are one of mine), but even a spray can of waxoyl is many times better than just doing nothing. Unprotected, in the UK, expect to start running into corrosion related MOT advisories at 8+ yrs, and MOT failures from around 10-12 years.
Paint is essentially useless in providing long term protection to anything on the underside; parts with just the factory applied powder coating can look very tatty even by the time of a car's first MOT.
The main bodyshell galvanising should protect the monocoque for 12-15 years, but anything bolted on underneath generally corrodes faster than you might expect. One particular weakness is the front bracket securing the exhaust; these can corrode away quite early and are needed to properly support the exhaust; if compromised, the weight of the exhaust can crack the manifold, not a cheap or easy repair. The exhaust attachments should be checked annually once the car is 3+ yrs old; the exhaust can be surprisingly long lived, but it won't be if it falls off!
where does it need protection
Main weakness is the rear twist beam, the spring pans are the first to go and usually the reason for the corrosion related MOT failures that get reported here. Replacement beams are reasonably priced, but fitting can be a chore and a little extra protection now should ensure it lasts the life of the car.
Sills are generally good for 12-15 years before you're into welding territory; if you're hoping to keep the car beyond this, I'd recommend some sort of additional protection in the box sections.; any of the proprietary products should work just fine.