DDR4 shouldn’t be confused with DDR3, the previous generation of SDRAM.
Motherboards in modern computers support DDR4 RAM. RAM that’s incompatible with your system either won’t fit, or won’t function properly. RAM comes in sticks, or memory modules, that snap into the memory slots on the motherboard. The wrong type of modules simply won’t work, while RAM with the wrong specs for your PC can underperform.
Before you start thinking about RAM capacity and frequency, you should ensure RAM is compatible with your motherboard and processor.