All assuming gen1 cars...
RMS failure is common enough, unless it's horrendous then you can just live with it whilst keeping an eye on the oil level.
IMS failure is the big one on the M96/97 engines. Essentially it's pot luck and unless you fancy dropping the engine and separating the 'box to replace it, then there's not a lot you can really do. My own rule of thumb is that if a car has managed to get past 80k miles then it'll probably be okay. They usually go between 40k-80k, but have been known to go outside of that. Expect a repair cost of between £5k-£10k, depending on what gets damaged when valves collide.
D-chunk and bore scoring are also an issue, which is why a boroscope inspection is a MUST do before purchase. You can help prevent this by fitting a low temp stat from Hartech, very easy to do.
Don't buy an auto, the 'box is crap. If you get one with 19" wheels then make sure it has PASM, as the ride is awful otherwise. You'd be better off with the 18" wheels and standard suspension, much better ride and drive, plus replacing the stock suspension with something better is cheaper
Sat nav is crap, actively avoid that and the Bose stereo as replacing that with aftermarket is mega bucks due to the MOST wiring. Sport seats should be a must-have too as the standard seats aren't very supportive.
Just do not buy without an inspection. Far too big a risk on these cars IMHO.