i want to trade a tepig to heart gold but I dunno if it will work.
This (kind) of question has been asked already here, so your question is a little bit against the rules. You should look below the title type-bar. There are questions that are kind of like the question your asking, highlighted in yellow.
It won't. The sprite, moves, and cry, or anything related to Tepig didn't even exist when HeartGold was made.
So no, you can't. Pokemon made in the Gen.V games (Black/White and Black/White 2) cannot be traded to Gen.IV games (Diamond/Pearl/Platinum/SoulSilver/HeartGold) directly. The Poketransfer Lab on Route 15 in the Gen.V games, however, allows you to move Pokemon from Gen.IV games to Gen.V games via DS Download Play.