How to add a custom filter (by coding) before access one wordpress page ? And where to call the custom filter?

How to add a custom filter (by coding) before access one wordpress page ? And where to call the custom filter?