That might need a disclaimer first: a shaver is a personal hygiene product. Those should just never be shared or bought "used". First in my opinion just for the yuck factor and then only secondary because this sanitary concerns thing.
You would not want to buy toothbrushes second hand and when surgical equipment is re-used the steps to ensure complete sterility are quite rigorous. So this needs to be put into perspective and a cost-benefit analysis has to be made.
Then in the case of an electric shaver, those blades on a cutting head will not last forever and eventually loose their edge. Some newer models seem to embrace planned obsolesence quite rigorously with a their one-blade design. That means that any cost or environmental benefit from a used razor is smaller than often imagined from the start. For shaving this is especially true: a sharp knife leads to less cutting. But blade egdes dull with use!
Even electric razors are neither fool proof nor the top solution for avoiding skin problems compared to regular, mechanical wet shave blades.
(Prevalence of acne keloidalis nuchae in Nigerians, 2007: The common etiologic factor was secondary to trauma from an electric razor whilst having a haircut, followed by spread of keloid from the beard area.)
Those machines often grab and tear hair out instead of cutting it. They can also get hold of skin and rip very uncomfortable wounds.
Anyone choosing an electric shaver has to try them out to see if their skin and hair agree with them. But that cannot answer how well these questions were answered for the previous owner of that particular model. The previous owner sold it for a reason and if that includes lacerations than any such device should be considered a biohazard and treated as such. If you are concerned about a possible virus infection: do not buy used. (Just for completeness: you might consider applying steam, dry heat above 160°C, ethylene oxide, sporicidals, glass plasma or gamma rays)
Therefore it seems to be a bad idea to use electric shavers at all? Not really and necessarily for all.
- Do not buy used personal hygiene products.
- If you do buy a used electric shaver, try to exchange the screen and blades of the cutting head, effectively just reusing the motor and battery and plastic wrapping for the device.
- Clean the device thoroughly in any case. These cases include "you bought it first hand and keep using it".
How do you clean that device?
Unfortunately, that depends a bit on the device and how it is constructed.
Manual tear-down, brushing and regular soap-water cleaning are a great start. But using the regular disinfectants like boiling water, rubbing alcohol, hydrogenperoxide or appropriately diluted bleach followed by thorough rinse and quick drying are even better. Alternatively you might also soak the screens and blades in commercially available dedicated disinfectants. These likely cost more but are not that much more effective to justify the cost. None of the methods mentioned so far are perfect though, anyway. Just try out what you already know is working as a sanitiser, then test that on your device. That is largely for material science. Usually those things are plastic and metal and quite resistant to those primitive chemicals you are about to use. If the device is one of the newer just wash it with water designs it will take quite some abuse in this direction without harm.
The first step reduces grime, builtup and that keeps the shaver in good operational conditions as well as diluting the bacterial load that might cause problems.
The second step really kills of the bugs. The quick dry is necessary to reduce the chance of rust counteracting all your eforts and investment. Depending on construction and methods used it might also be a good idea to keep an eye on the lubrication of the mechanical parts. Washing away all the machine's oils will shorten its lifetime and your pleasure.
Things to consider: The male beard hair and facial skin - challenges for shaving. 2016
Advice to try out: Electric Shaver Maintenance 101 or
How to Sanitize an Electric Razor or Proper Sanitizing of Electric Razors or how to sterilize an electric razor head.