How do I get all children's taxonomy term IDs?
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.