Usually, you would include your filter into the filter chain and override the doFilter() method as @bilal_ahmad outlined in his code example.
Depending on your understanding of how to "block/abort" the request, you could do one of the following:
Check for the right condition and send an appropriate HTTP response (e. g. 404 Not Found or any other 4xx or 5xx code that makes sense for your use case) - exactly what @bilal_ahmad mentioned. You can find a simple example of a LoggingFilter  in the AEM Maven Archetype .
Proceed with request processing but skip any additional filters. Probably not what you are looking for.
Stop processing all together and not even waste additional computing resources by sending any kind of response. You probably don't want to do that as this may lead to unexpected results.
If your use case is really about blocking and/or dropping incoming requests (e. g. as a protective measure against DoS/DDoS, unwanted crawlers or other clients, etc.) my suggestion would be to stop them at an earlier stage. You could leverage some kind of web application firewall (WAF). Sometimes certain modules for Apache HTTPD do the job (mod_security , mod_qos  or for simple cases even mod_rewrite ).