How can I have a custom module checked for deprecated functions?
Read Dries Buytaert's blog post on How to prepare for Drupal 9

drupal-check


  If you work on a Drupal site as a developer, run drupal-check. Matt
  Glaman (Centarro) developed a static PHP analysis tool called
  drupal-check, which you can run against your codebase to check for
  deprecated code. I recommend running drupal-check in an automated
  fashion as part of your development workflow.


Link: https://github.com/mglaman/drupal-check

Upgrade Status


  If you are a site owner, install the Upgrade Status module. This
  module was built by Acquia. The module provides a graphical user
  interface on top of drupal-check. The goal is to provide an
  easy-to-use readiness assessment for your site's migration to Drupal
  9.


Link: https://drupal.org/project/upgrade_status



Maybe also learn the background info of drupal-check reading Matt Glaman's blog post about Testing your Drupal code base for deprecated code usage with PHPStan.