First, here is the habitat interface:
There are many ways to obtain golds:
Production acquisition of habitats (little amount)
Treasure Ship Summoning (watch ad / large amount)
Offline hourglass (related to offline duration, the max limit can be increased along with growth, current highest limit is 24.5h)
Wooden box and Photo mission
Time token (gems to golds)
Sell collections and materials in Material Box (useful in early game)
Here is how to optimize:
Creating penguins always take priority over anything else.
Which to upgrade?
Compare the golds efficiency of several high-production habitats and choose the one with higher efficiency to upgrade.
Which to evolve?