Form alteration is not working from within my form class I am following https://www.drupal.org/docs/8/api/form-api/introduction-to-form-api for my hello world module.

Below is my code

namespace Drupal\hello_world\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements an hello_world form.
 */
class HelloWorldForm extends FormBase {

    /**
     * {@inheritdoc}
     */
    public function getFormId() {
        return 'hello_world_form';
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(array $form, FormStateInterface $form_state) {

        $form['phone_number'] = array(
            '#type' =&gt; 'tel',
            '#title' =&gt; $this-&gt;t('Your phone number'),
        );
        $form['actions']['#type'] = 'actions';
        $form['actions']['submit'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; $this-&gt;t('Save'),
            '#button_type' =&gt; 'primary',
        );
        return $form;
    }

    function hello_world_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
        if ($form_id == 'hello_world_form') {
            $form['phone_number']['#description'] = t('Start with + and your country code.');
        }
    }


}


I also cleated cache. Not sure why form is not altering.
Use your hello_world_form_alter in your module file. I guess should be hello_world.module. I guess you already have a folder hello_world where you placed the file above. In this folder you should also have an .info.yml file at the same folder place your hello_world.module file.

Please check https://www.drupal.org/docs/8/creating-custom-modules. You will find a lot of tutorials about how to create a custom module. Just google it!