How do I get all children's taxonomy term IDs? How do I get all children's taxonomy term IDs in Drupal 8?

$tree = \Drupal::entityTypeManager()-&gt;getStorage('taxonomy_term')-&gt;loadTree($vid); uses the taxonomy term name, not the taxonomy term IDs.

What happens if the taxonomy term names are equal?
You are close, but you want to pass some additional parameters to that method. 

$vid = 'my_vocab_machine_name';
$parent_tid = 87; // the parent term id
$depth = 1; // 1 to get only immediate children, NULL to load entire tree
$load_entities = FALSE; // True will return loaded entities rather than ids
$child_tids = \Drupal::entityTypeManager()-&gt;getStorage('taxonomy_term')-&gt;loadTree($vid, $parent_tid, $depth, $load_entities);


See the api documentation for more info.