How do I disable a form? I want to disable a form in Drupal 8.

In D7 you could've done it in an alter hook like this.

$form['form'] = ['#value' =&gt; 'the form you are looking for is gone!']


What can I do in Drupal 8? 

What I tried so far:

function hook_form_FORM_ID_alter () {
  $form[] = []; // $form[] or $form both will not work.
  $form['dunnoWhatToWriteHere'] = [
    '#type' =&gt; 'markup',
    '#markup' =&gt; t('The form is gone),
  ];
}


What I suggested is that I would overwrite the $form array with an blank one but as I run my xdebug drupal seems to just ignore it because the $form array in its native status exists although I tried to overwrite it with a blank one.

Do I also have to call a Formbuilder?

 $form = [];
 $form['error'] = [
   '#type' =&gt; 'html_tag',
   '#tag' =&gt; 'p',
   '#value' =&gt; t('The form is gone'),
 ];


That one worked for me :)
What I suggested is that I would overwrite the $form array with an
  blank one but as I run my xdebug drupal seems to just ignore it
  because the $form array in its native status exists although I tried
  to overwrite it with a blank one.


What you describe does look like caching. Drupal returns what is cached, without running the code to build the form again.

You don't give much information, but you did tell in the comments, the form is part of a rendered page. If the form would be a page on it's own, then this is about access. If you only want control if a part of the page is displayed, then this is about blocks. The first thing to try is to configure the visibility of the form  block. If you can't configure it in ui, then there are several ways to put custom code in block or page level to remove the block. This depends when and where the block should be displayed.