In the UK, generally chosen by party membership. There’s been some experiments with open primaries, but nothing really substantial.
It’s probably worth mentioning that, because the timings of our elections are generally left to the whim of the Prime Minister, candidates are normally elected by the party way in advance so they’re ready just in case anything happens. Our election cycles also usually last only six weeks, which isn’t enough time to run an internal election and then campaign.
I still see it sometimes when connecting my Steam Deck to my TV