One way to do this (there is never just one way to do something) is to simply replace the old building with a new one by
Destroy()ing the gameObject of the old building and then
Instantiate()ing one of the next level with the same position, rotation and parent.
One drawback of this method is that the building loses all of its internal state when you upgrade it. If that is a problem, then you might want to create two separate gameObjects for each building with a parent-child relationship. The parent persists during upgrades and carries all the functionality which is independent from the upgrade level of the building. The child which contains all the components where the upgrade level matters (including the SpriteRenderer/MeshFilter that stores the appearance). That way you can replace the level-dependent child but retain the level-agnostic parent.
I could also imagine several other solutions to the problem of managing state during upgrades, all with their own advantages and disadvantages. But I don't know what your requirements are, and I don't know how familiar you are with more advance programming concepts (like ScriptableObject's or C# Attributes). So I will leave that for another question.
Storing the prefab for the next upgrade level
You could either implement this on a global manager-object which has prefab-references to all upgrade levels of all buildings and also contains the information what's the next upgrade level for each building. Or you could implement it on the buildings themselves. Give the script that handles the upgrading a reference to the prefab for the next upgrade level. Both could work, and which one you choose is mostly a question of how you prefer to structure your project.
Getting the cost of the next upgrade level
In either case, it is possible to access variables of an uninstantiated prefab. It's rarely a good idea to change variables of prefabs at runtime, but there is no reason to not read them. So you can put the cost for upgrading a building into a public variable on the prefab for the next upgrade level.
So you can simply add a
bool CanUpgrade method to the script which handles the upgrading which compares the cost of the prefab for the next upgrade level to the current resource count of the player. Then the script which handles the UI can use that method to determine if it should enable or disable the upgrade button.