A tariff is effectively just an import tax. When an importer brings the goods into the country, they have to pay the tariff to the government. But they still need to make a profit, so they raise their price to the distributor they sell to. And the distributor has to cover the increased cost, so they charge the stores more. And then the stores charge higher prices to the end consumers.
In some cases, tariffs might be used to target a specific sector or industry to protect domestic manufacturing in that area. The idea is that by raising the price of imports, you make domestic goods relatively cheaper, so consumers will prefer the domestic. But if tariffs are applied broadly, and the country doesn’t have enough domestic manufacturing to meet demand, and its economy relies heavily on imports, then tariffs just raise costs to consumers for no reason.