Suggestions for imei repair

Hi folks, I just need to know what is the right method to write certificate on Samsung phones. I mean when we want to write a new certificate in a phone do we simply need to go to write certificate and do it or is there any other things we need to take care before doing it. I think I read somewhere that we need to wipe the security/ efs before writing a new certificate, is that right? So if someone can please tell the right method of writing a new certificate so no one faces any issues in the future. Ta