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?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)