How to know what filter to use and how to use it?

You will need to know WordPress hooks and their uses. for list of hooks please find Where can I find a list of WordPress hooks?