YOU MUST BE ROOTED
After rooting the device.
Flash a correct custom recovery.
Download the appropriate custom Rom. Usually a .zip file.
Copy downloaded custom Rom to Sdcard.
Boot into recovery using device specific key combinations.
Wipe data/factory reset.
Select install/flash zip from Sdcard.
Scroll to the custom rom and select.
Sit back and allow the rom get flashed to the android device.
When phone flashes and reboots.
Boot into recovery again and perform a factory reset.