Which f150 is best 3.5 or 5.0 in terms of reliability and longevity?

I am planning to buy a used vehicle soon and would appreciate any tips or advice on choosing the right engine.