Not always. Ethopia, Thailand, and Japan all managed to avoid being colonized. There are tens of millions of people in central and South America who still speak their native languages and maintain culture. The official, and most widely spoken language of Paraguay is Guarani not Spanish. The Polynesians were conquered but were able to fight to a truce, including in New Zealand where the Māori simply told Europeans who showed up on their shores they could adopt Māori culture or be killed. That lasted over a hundred before the British finally invaded. In South Africa, Zimbabwe, Zambia, Mozambique, Angola, and Namibia Europeans tried to establish white only governments and were all defeated by popular resistance.
Yes there was massive genocide, but the most effective weapon was diseases that the native population had which killed off the colonialists. After that a strong government without internal conflict. Lots of people in the Incan empire hated the Incas so they were happy to help the Spanish invaders. This is basically how the aliens discovered where Earth is in the Three Body Problem. Where as in Ethiopia, Thailand, and Japan the people had a consolidated government with strong unity and popular support for the system. In New Zealand the Māori fought intensely amongst themselves but they had a unified culture and language and political system.
Lastly the best resistance came from peoples who didn’t think they were invincible. They quickly adapted the weapons and technology of the colonizers. Turns out the masters tools can be used to destroy the masters house.
So how do you win against the Three Body Problem aliens? First get our own house in order so all humans are on the same side. Second see if there is something in our biome which we’re find with but hurts the aliens. Third learn as much as possible about the aliens and their tech. This last one is why the aliens sabotage human physics and science.