20-30 years ago the NHS probably was great, but not any more, not since all the illegal immigrants and asylum seekers have bloated it, and they are not the only problem, the brits who live off the state and cant be bothered to get a job and end up with various issues due to a lack of exercise and diet are just as bad IMO.
It (the NHS) is at least in part paid my National Insurance contributions more info on the rates
Here and is deducted from gross pay, as is Income Tax.
Generally you get your NI card when you turn 16, and this probably equates to your social security number, its with you for life, and so every employer will deduct your NI automatically and they also contribute on your behalf. In order to get a full state pension you need to have paid into the NI system for something like 30 years, otherwise you only get partial state pension. I believe you can also get an NI card when becoming a British citizen.
NHS coveres pretty much all health care, and hospital fees along with dental.
Thats a start, im sure someone else will correct me if im wrong, and/or add to the explanation.