How do I implement hook_form_alter() in a module?
Here is a working example I have pulled from a project and altered to have your module name.

Add this at the top of your .module file:

use Drupal\Core\Form\FormStateInterface;


Then copy this in

/**
 * Implements hook_form_alter().
 */
function constellator_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

  // Adding custom validation for the welcome page type field.
  if ($form_id == 'node_article_edit_form' || $form_id == 'node_article_form') {
    // Do some stuff.
  }
}


I think most likely what you aren't doing is clearing the Drupal cache to register the hook.  You can click on "clear all caches".  Or better yet, install the drush command line utility and use "drush cr".