Post [Q] Creating Custom Rom

Good Day Everyone! Just want to ask about creating rom, how can we determine if the existing custom rom is compatible to our device?Is it possible to make that rom compatible to our device?How?What is the main files or folder to change?or what file should be change to make it compatible to our device or build?Hope to hear from anyone expert.Thank u and Godbless..