The following code will return all the available fields as an array by a field type. You can pass the field type that you want to load within getFieldMapByFieldType() function.
$fieldsArray = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('boolean'); $fields = $fieldsArray['node'];
“boolean” is a field type here. The returned array will have the field name as a key, field type, and the list of bundles in which this field gets mapped.