I find the answer. After building my arguments for wp_insert_post() function and passed it to a variable $pid i set the following line after that and everything works slightly.
wp_set_object_terms($pid, 'cars', 'types', true);
I find the answer. After building my arguments for wp_insert_post() function and passed it to a variable $pid i set the following line after that and everything works slightly.
wp_set_object_terms($pid, 'cars', 'types', true);