Simple. Do your research in advance so you know what a fair price should be, and then thoroughly inspect and test the vessel before opening negotiations. Any faults get used by you to negotiate the price downwards.
Also, understand the market forces driving boat prices: when everyone wants them the prices are firmer, when they’re harder to shift prices are far more negotiable. In practice that means buying at the end of the boating season and in mod-winter just after Christmas when people may need cash is a good time to buy, and also when the economy looks uncertain or is in recession as things look to be heading right now.
For expensive/complex vessels the services of a boat surveyor are worth the expenditure as they can save you from buying a money-pit and can find faults you wouldn’t even notice.