How to inject a service in another service?
The service you need is entity_type.manager:

.services.yml

services:
  hsbxl_members.membership:
    class: Drupal\hsbxl_members\MembershipService
    arguments: ['@entity_type.manager']


MembershipService.php

namespace Drupal\hsbxl_members;

use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
 * Class MembershipService.
 */
class MembershipService {
  protected $hsbxl_member;
  protected $entityTypeManager;

  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this-&gt;entityTypeManager = $entity_type_manager;
  }

  public function MembershipsAll() {
    $query = $this-&gt;entityTypeManager-&gt;getStorage('node')-&gt;getQuery();
    $query-&gt;condition('status', 1);
    $nids = $query-&gt;execute();
    return "Hello World!";
  }
}


The create() method is unnecessary as services use constructor injection.