How do I get a list of bundles?
To get the bundles for an entity type, use the entity_type.bundle.info service, like this:

\Drupal::service('entity_type.bundle.info')-&gt;getBundleInfo('ENTITY_TYPE')

or use dependency injection to inject the service.

See the documentation for getBundleInfo for more information.