Default Flashing firmware before ROM?

There's a custom ROM that I wanna flash and it requires a different firmware. Do I flash the firmware first then the ROM? Also, when I flash the firmware is it just like flashing a custom ROM?

Sent from my HTC 1M8