That depends on the particular model phone and the particular ROM you're rooting (the ROM gets rooted, not the phone itself). There's no "one size fits all". If you have a common phone, try the developer forum for that phone at
XDA Forums, if you have an uncommon phone, it could be that no one has developed any root method for the ROM you're running.