Get only children category name

For this specific question, Try this

  $categories = get_the_category($id);
  foreach($categories as $category){
        if($category->parent != 0){

         // Display it here
         echo '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '">' . esc_html( $category->name ) . '</a>';

        }
  }