Some people have money and pay the cost.
Some people still have access to an NHS dentist because they've stayed with them for years.
Some people use something like Denplan to spread the cost.
Some people can't really afford it and get into debt.
Some people don't go and suffer poor dental health - you might notice in areas where a lot of poorer people live, they often have visibly bad and/or missing teeth.
Some people use whichever NHS dentist they can find and don't have the luxury of choosing one with good reviews.
If you're not registered with a dentist you can often access to free or cheap emergency dentistry when in pain - if you call 111, they will tell you how to access this, a relative has done this a few times.
Sometimes people go to 'the dental hospital' where they have their treatment done by dental students under supervision, this is free and could be an option if you're near a city with a dental school.
It's not great, but there are solutions other than paying privately if you don't want to or can't pay.