How to show entityQuery results as block I use entityQuery to retrieve nodes related to actual content. Now I don't know how to add them to template and show them in my theme.

In Drupal 7 I used Bean module to create blocks as entities. The module states the following, which I don't fully understand:


  As Drupal 8 supports fields on its block entities, this module is not
  needed for new sites.


So how do I get the results of my entityQuery into blocks to afterwords use them twig templates?
Try the above suggestion:
Create Custom Block for example MyBlock. 

In the your src/Plugin/Block/MyBlock.php File. 
implement build method and getNodesBuild method to get the nodes build:

  public function build() {
    return array(
      '#theme' =&gt; 'mymodule_my_block',
      '#nodes_build' =&gt; $this-&gt;getNodesBuild(),
    );
  }


NB: Change the $nids array by the result of your Query.  

  /**
   * This function return view_builder of list of nodes.
   * @return array
   */
  protected  function  getNodesBuild(){
    //- Replace this by the result of your Query
    $nids = [38, 39];
    //- Get the current lang
    $language_manager = \Drupal::service('language_manager');
    $language = $language_manager-&gt;getCurrentLanguage()-&gt;getId();
    //- Get view_builder for node entity type
    $entity_type_manager = \Drupal::service('entity_type.manager');
    $view_builder = $entity_type_manager-&gt;getViewBuilder('node');
    //- Load nodes
    $nodes = Node::loadMultiple($nids);
    return $view_builder-&gt;viewMultiple($nodes, 'teaser', $language);
  }


Implement hook_theme in your mymodule.module

/**
 * Implements hook_theme().
 */
function mymodule_theme($existing, $type, $theme, $path) {
  return [
    'mymodule_my_block' =&gt; [
      'variables' =&gt; [
        'nodes_build' =&gt; [],
      ],
      'template'  =&gt; 'mymodule-my-block',
    ],
  ];
}


templates/mymodule-my-block.html.twig 

  {{ nodes_build }}