I always put a whirlfloc tablet in the wort, 15 minutes before the end of the boil. Works for me. Other things are Irish Moss (sea weed derivative) or Isinglass (from fishes swim bladders - I know of at least one brewery who won't use this so they can claim their beer is vegan friendly....).
Mash management also helps - when sparging recirculate the first runnings back into the mash until you can get clear wort, then fill your kettle. Hop strainers in your boiler, and don't try and get every last drop into your fermentation vessel. When bottling/kegging, make sure the end of your syphon stays out of the trub - again don't try and get every last bit out. You can also add gelatine, but I've never done that - if my beer ends up cloudy I use my pewter tankard.....