You can't really prevent it, fortunately
Here is a small example.
Same case where you want to prevent someone from breaking into your house. You can add an alarm. You can add a giant fence that runs around your house with barbed wire at the top. Two bull terriers to accompany the perimeter. A bunch of locks on each door.
But then you must realize, there is no alarm that cannot be disarmed. There is no dog that will withstand being put to sleep. There is no fence too high to climb or break through. And of course, there is no lock that cannot be picked.