When I go into the Open Designs screen and then for example remove all components for my frigate and then add in one Energy Lab it tells me for that with that one component on my ship that the Purchase Cost of my ship is 150 with a maintenance cost of 43
The purchase and maintenance costs are the total price and maintenance costs for all components comprising the ship. Each time you add another component the total will increase by the cost of that component.
The energy lab cannot be built until I have gold and silicon
You will have a stock of gold, silicon and other resources at your home planet, enough to build quite a few ships. The yellow coloured warning "We do not have a supply of required resources" is informing you that you currently have no means of replenishing that supply. Locate suitable planets or asteroids with the resources you need and build mining stations there. The desert planet in your home system will probably have only a small amount of silicon. If so, leave that one and look in other systems once you have the technology.
The only way I could see a ship with only having one component, an Energy Lab
As you removed components from your frigate, you would have seen red warning messages "Must have a ...." appearing in the box above the design. The design is not valid and cannot be saved until these messages have been removed by adding the required components, so you cannot design a ship with only one component.
Is that how it works because it does not make sense
The purchase cost is a one-off price per ship.
The maintenance cost is an ongoing annual expense.
Ignore the price of gold and silicon because you are not purchasing them, you are taking them from stock.
And what about the price of gold and silicone changing
That will affect profit and loss in trade, but not the official price of the component or ship.