Currently, they do nothing. In the future they will be used to upgrade relics. You get them by salvaging relics.
What do Forge Cores do?
As of v0.19, Forge Cores does absolutely nothing. Fragsworth
(ClickerHeroes dev) has vaguely mentioned that "forge cores will be
used to upgrade items". By items, it's safe to assume he means relics.
As far as the scope of what Forge Cores will be capable of, only time
will tell when it's implemented. Right now it's just all speculations.
How do I get Forge Cores?
You can obtain Forge Cores when you salvage a relic. The amount of
Forge Cores a relic is worth depends on the rarity as well as the
level of it. However, the value of a relic seems to leans towards the
level of it more, rather than the actual rarity. As an example, a
level 50 common relic will give more forge cores than a level 40 rare