How to overcome error caused by non-existent service "entity.manager"? I am running drush first time in my Drupal 9 project and getting the following error
 In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
  The service &quot;sanitize.userfields.commands&quot; has a dependency on a non-existent service &quot;entity.manager&quot;.  

Is there anything I have missed?
I was trying to list all available commands.
After @hurdi's comment I found  drush --version drush cr are  working.
Note: It is my first Drupal setup and I'm learning it.
As folks (Hudri, leymannx) alluded to in the comments, entity.manager was deprecated in Drupal 8 which means it was removed in Drupal 9. The project that has the code that's calling entity.manager is not ready for Drupal 9 (or at least the version you have installed is not ready for Drupal 9). You may want to look for alternative modules if the one your using isn't ready for Drupal 9.
This one particular error is relatively simple to fix though, you may just need to replace any references to entity.manager with references to entity_type.manager. This issue on d.o gives a good example of what you may have to do.
As @Jaypan noted in the comments, entity_type.manager may not always be the correct replacement. From the entity.manager documentation:

Use \Drupal::entityTypeManager() [i.e. entity_type.manager] instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.

Note: if this issue is being caused by a contributed package, e.g. a d.o module or theme or other package included by composer, you need to work within that project's issue queue to patch the project instead of updating the files directly in your codebase. At the very least, you'll want to create a local patch in your composer project and configure composer to apply the patch.