What is a safe way to root a device ?
The best method would be this way:
 unlock bootloader>flash custom recovery from fastboot>flash super SU .zip file from recovery 
if this is possible, on some phones it isn't..
If you by safe way mean "the way that won't screw your device" then there is no way, in every possible way of rooting it's possible that something goes wrong but in most times flashing stock firmware resolve trouble.