Wouldn't it be as easy as having money invested with a foreign broker? Granted, this won't work if capital controls prevents money from easily flowing across the border, or if your country is sanctioned.
That’s assuming that you have significant money to put into savings. Most people live paycheck to paycheck so that will only protect 5% of their income that they can spare to put away. Ideally you could get paid in a stable currency