How do I determine a fair offer?

I've watched many car edge videos on how to get to the OTD price. But how do I get to a reasonable offer that is not insulting to a dealer but is aggressive enough to get me a good deal? I'm hoping to pay cash for a vehicle, but I'm open to financing if it gets me a better deal and does not have an early payoff penalty. I'm looking for a brand new F-150.

Here's a couple of examples:

1FTFX1E52PFB22897

1FTFX1E55PKE00103