I see many videos on youtube where they tell you to get residency visa in countries that are unlikely to be involved in a world war 3.
Wealthy individuals are already doing this; in fact, they acquire properties and assets abroad in case something adverse happens in their country. You have that option if you are rich, but if you're poor or middle-income, your chances are to go to remote areas in your country and live there.
Is it really enough to have a residency visa? I think the country you are a citizen in can still force you to come back to join the war if they want to. Either they already have such a law or they can create one when it's time. The country you would have a residency visa at would have to deport you. I think the only way to avoid such a situation is by getting citizenship in a country that is unlikely to join a war, so residency is not enough.
Suppose you're living in a totalitarian system. In that case, that's possible, but not in a democratic country, in times of war the only time they will want you back is if you can be an asset in times of war, you don't expect your government to force you to go home if you're aging or you do not know to fight, in times of war they utilize personnel capable of depending a country.
A good government allows you to live in another country, so in times of rebuilding, you can help by sending funds or any resources that can aid in rebuilding a nation.