To upgrade buildings, you need to reach a specific Guardian level, which varies depending on the building.
Additionally, specific resources are required for upgrades. Once you have enough resources, a green arrow will appear on the building. Clicking on it will open a window with the Upgrade button.
If the Upgrade button is grayed out, the building cannot be upgraded at the moment because resources are currently being produced.