If you want to understand this stuff get the following book:
https://www.amazon.com/dp/3319192000/?tag=pfamazon01-20
See section 7.2 where the full detail is given.
Now what you do is start with 2 massless spin 1/2 fields. You notice it has SU(2) global symmetry but you want it to be local. To do this we add three massless spin 1 fields Wi to the Lagrangian. But massless spin 1/2 fields have a global U(1) symmetry so we want that to be local so in a similar way to EM so you add B another spin 1 field. The Lagrangian is both locally SU(2) and U(1) invariant. All the fields are massless. But let's say you want the fields massive, at least some them anyway. It turns out if you look at it and you want mass then you will loose SU(2) symmetry - bummer. But you insist. Why - well we have some experimental evidence at least some of these fields have mass but ignoring that and purely as an intellectual exercise how would you go about it? The only ingredient we haven't used so far is a spin 0 field. So let's try this.
You find a Lagrangian with two terms p and λ and a spin 0 field if you want it to have local SU(2) symmetries. The spin 0 field is related to the Higgs. It is in fact two complex spin 0 fields called a doublet - the original spin 1/2 fields are a doublet as well. This has 4 numbers but since it has local SU(2) gauge freedom similar to the EM U(1) gauge changes to them make no difference so those fields can't be measured - no experiment can detect them. It is in that sense we have these 'unreal' fields appear - due to all these symmetries their values can't be measured in experiments. The 4th field though has experimental consequences so is real, in that sense. They are all real, in the sense they are there but have no measurable consequences. This gauge freedom, again similar to EM, means it all depends on what gauge you choose. But regardless some fields don't have physical consequences - they just appear in our equations to ensure symmetries.
During very high temperatures like during the early universe the values of the p term is such the potential energy term from the spin 0 field Lagrangian has a single minimum and particles doing what particles do generally go the minimum.
Now as temperature decreases the value of p changes and the potential energy plot develops the famous Mexican hat potential you have probably read about. The particle naturally wants to still go to a minimum so 'rolls down' so to speak to a minimum on the hat rim. This is the so called spontaneous symmetry breaking you have heard about. Once this happens you have a look at what the Lagrangian now is (see equation 7.97 in the book above) and behold you get the EM Lagrangian and other terms for other particles (the W and such) with terms in front of some that are interpreted as mass terms.
As you can see its quite complex and you, like me, will need to go through it a couple of times. It all fits together elegantly and beautifully and confirms the very striking fact - symmetry is the key thing here. This is all very strange and IMHO a deep deep mystery.
Thanks
Bill