How do I get the form field value? The question is clear from the title itself : 

I have tried :

function mymodule_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
          $form_state-&gt;getValue('field_p_fqdn');
          $form['field_p_fqdn']['und']['#default_value'];
}


where field_p_fqdn is my field name .But both didnt worked . Any idea ??
Depending the field type, it could be:

For exemple for plain text:

$form['field_p_cert_fqdn']['widget'][0]['value']['#default_value']


or

$form['field_p_cert_fqdn']['widget'][0]['#default_value'];


or

$form['field_p_cert_fqdn']['widget']['#default_value'][0];


or for entity reference:

$form['field_p_cert_fqdn']['widget'][0]['target_id']['#default_value'];


or some other thing

I would recommend you to use the devel module: https://www.drupal.org/project/devel (with the kint submodule enable). With this, you can add 

dpm($form); 


in you alter function to get the structure of the $form.