Pretty straight forward What kind of conventional firearms would be best for fighting armored and unarmored robots. Is any particular round effective at destroying electrical components or motors? Would a weapon favor accuracy or rate of fire? Is there anything feasible that is man portable?
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
If you can take out their visual sensors, they would be much easier to destroy. Robots don't have eyelids or tear ducts so clearing paint from the cameras would be difficult.
To take out armoured robots needs something armour piercing or can get around it.
Spraying acetone could also help as it will dissolve any plastic parts such as seals and insulation causing the bot to short out
A high powered laser can burn out the optical sensors blinding the robot permanently.
Do-it-yourself napalm would also work overheating the robot and melting internal components.
Most of these I've focused on easy to get methods as armour piercing rounds and military weapons are hard to get.
For me, the best weapon to fight against an army of fighting robots would be a classic EMP, but if you want to avoid friendly fire, I think it depends on what kind of robots they are. Are these Terminator-like robots, mecha robots, human-sized, building-sized?
Mechanised and AI combat would mean unmanned vehicles and equipment, which would actually remove the ethical constraints around an existing ammunition type; Depleted Uranium Rounds.
These are your typical tank buster, armour piercing rounds of ammunition that the US has used in previous combat theatres to take tanks out of the equation very quickly. The problem with them is that they pretty much bust tanks by generating massive amounts of heat and pressure within the tank, causing it to explode. There's no way a human inside the tank can survive that, so it goes against some of the modern doctrines of military combat. I won't discuss that here because of the complexity of the ethical questions and the fact that it's out of scope for this answer; suffice it to say that if people aren't in the mechanised units, DURs are now back on the table.
These are single round 'buster' style ammunition, so rate of fire is less of an issue over accuracy. These are primarily used as tank ammunition, but if we're dealing with a fleet of drones and other mechanised weapons, I'd imagine that with sufficient motivation the military engineers would find a way to miniaturise the technology, something no-one has done to date because of the ethics of radioactive anti-personnel rounds, but to take out AI drones would be far more feasable and appropriate an option for the military to adopt.
Obviously an EMP would be the go-to for destroying anything electrical.
There's also disrupting the ability for machines to communicate (viz. radio jammers).
Thirdly, water. Water is everywhere, and electronics and water don't mix. I'd expect an armored robot to be built water-sealed, but hey, if it's taking rounds of normal ammo, that would be a lot of little holes that water can leak into.
For destroying the physical components directly, I'd go for anything that causes wide damage (shotguns, basic explosives / home-made bombs, and corrosive chemicals). Electronics often have catastrophic failures if one piece goes wrong, so a wide-blast like a shotgun would increase the chance of hitting a sensitive component. Explosives are good in most situations, and can be made with basic components (same process for creating fertilizer, as fertilizer is an explosive!)
Corrosive acids and liquids inside simple plastic balloons, or as part of a basic explosive, could be helpful as (a) liquids get everywhere, (b) machines aren't exactly going to drown themselves in water to wash off the corrosive acids, and (c) they're (relatively) easy to create and manage.