The people must be armed, and educated in how electronics, computers, software, wireless communications, satellites, and AI work, so that there is never a critical technological knowledge gap between classes and a resultant enslavement opportunity. High schools worldwide must be reformed to teach kids how all the stuff of the modern world works. As for which arms would work against robots, any of the largest rifle calibers is my first quick guess. Other than that, there’s waiting ‘til they run out of power, and trying to cut them off from the nearest power supply.