There are various reasons a country choose to use tariffs like protection for nascent industries, national defense purposes, combating aggressive trade policies, and environmental reasons (are common examples).
A tariff is meant to alter the balance of trade between the tariff-imposing country and its international trading partners (a tax imposed by a governing authority on goods/services entering/leaving the country focused on a specified industry/product).