In an episode of The Clone Wars CG-animated show, we see Obi-Wan get shaved by what appears to be magic:
It's not quite clear what the medical droid is doing, only that it doesn't sound like a shaving device we would recognize, and that it completely disintegrates his hair and beard.
At least some members of the galactic community still use traditional razors; Galen specifically asks for one while being held captive on Vallt:
"I am Chieftain Gruppe. Have you been comfortable? Is there anything you need?"
Galen rubbed the growth that covered his cheeks and chin. "A razor. A hot bath. An extra blanket."
Catalyst: A Rogue One Novel Chapter 2: "Isolation"
Razors appear to still exist, but depilatories seem to be the norm; Gilad Pellaeon continues to use a razor, but his companion evidently prefers the chemical solution:
"I'm shaving, Lieutenant..." The boy's like one of those hyperactive little rodents on Ber de Val, all mangy hair, twitches, and zero attention span. "I need to concentrate."
"Might it not be safer to use a depilatory rather than a razor, sir?"
No Prisoners "Prologue"