The answer to your deliberately ambiguous question is the same. Enforce the law.
> What if a lot of people do not want to remain in this country?
They will pack, leave and try to migrate and be accepted under the umbrella of other countries typically. It is happening a lot in the last decades, by good (and sad) reasons.
> What if the majority of people would hate their country (but want to remain in it).
They could use the tools specified in the law to change the bad parts and improve their country democratically. As they are a majority, they are probably doing this yet since years. They must have in mind still that there are international laws and treaties.
> What would happen if 100% of USA demand the independence from themselves and require to be called "Pantsdemonium, the land of the pants-free" from now on?
Just a change of name (and interesting parties, like the national day of the duck and so). On the other hand, if you can't stand to be in the same room with yourself, go to see a doctor as soon as possible.
> and if it was the 90%?
A change of name plus a 10% of people driven off their own country, typically by violent means, if we study the human history.
> and if it was the 85.45342%?
the same... and more people in exodus.
I'm asking what happens if in a part of a territory the vast majority of population doesn't want to be part of that country.
If you want to talk of Catalonia, I can ask what the Central Government can do when 82% of the population (and this includes half of people that wants independence and half of people that doesn't want independence) would defend a LEGAL and proper done referendum.