Restrict vocabulary on entity_autocomplete form field targeting taxonomy terms
The vocabulary is the taxonomy term's bundle, so you just have to add a target_bundles array to the #selection_settings entry. In my case the desired vocabulary ID is 'category'.

$form['p_cat_ac'] = array(
    '#type' =&gt; 'entity_autocomplete',
    '#title' =&gt; t('Product Category'),
    '#target_type' =&gt; 'taxonomy_term',
    '#selection_settings' =&gt; [
        'include_anonymous' =&gt; FALSE,
        'target_bundles' =&gt; array('category'),
    ],
);