You're gonna need to pay attention to a few things. The most obvious is the socket (LGA 1151 and AM4 for example), but you also want to look at the memory (DDR3 and DDR4 for example) and chipset compatibility (Z390 and B450 for example).