1)Flash TWRP recovery.Link below(I hope you now all the basic stuff like Rooting flashing recovery etc.)
2)Download and extract ADB on your pc
3)Reboot into recovery.
4)Now in TWRP go to wipe
5)Select Format data.(this will erase all the data on your phone)Once its complete go back
6)Go to the advanced.
7)Click the ADB sideload option and swipe to start sideload
8)Now connect your phone to pc.
9)Go to the folder where you have extracted adb and open cmd there by holding shift and clicking right mouse button.
(Now you need to have a working custom rom in your pc. Copy it to the folder where u had extracted adb.)
10)Now type there
adb sideload name of your rom.zip
12)Once everything is done reboot your phone.Now your device will be out of bootloop