Resources can be harvested by hitting trees or rocks with a pickaxe, having resource harvesters, or by killing bosses. You can also place Gold Mines to farm gold. Gold can be used to buy items and upgrade buildings.
Upon death, players lose 30% of all their currently owned resources. They will lose the same percentage of resources when the Gold Stash dies (thus making it easier to build a base after the Gold Stash's death and not worrying about farming resources at all).