The fact a country would ban Bitcoin has nothing to do with keeping the funds safe.
Well, that's not strictly true. If you keep your coins on a centralized exchange, web wallet, or similar, and your government bans access to these services, then your coins are effectively lost. A nationwide ban won't affect your coins only if you are the only person holding the relevant private keys, which should obviously be the default position but unfortunately we know this is not the case for a many users.
the only way to stop people from holding bitcoin is when the government ban the internet, which is impossible.
Or they make it illegal to access the global internet, as in the case of North Korea. Or they show up and seize your hardware and devices and confiscate your coins.
Keeping your bitcoin safe through a nationwide ban requires two things. Firstly, it requires you and only you to have control of these coins. This means keeping them stored in your own wallet in which only you control the private keys. Secondly, it requires the government not knowing that you own bitcoin, so they don't physically coerce you in to handing them over of confiscating your wallets. To this end, you should buy bitcoin as anonymously as you can and transfer them to a wallet stored on a medium which you can safely and easily hide from both electronic and physical searches. A paper wallet would probably be the best choice.