It should say on the motherboard's page, another thing you have to know Is that If you're going to buy an NVME M.2 That they have a different chip end. NVME uses PCIe x4, these are faster than normal x2, but these m.2's usually cost a bit more. Whilst Normal M.2 use PCIe x2, these are usually your cheap m.2 drives, there fast but if your going to buy one an SSD will also do the trick. It should say which one your motherboard is compatible within specifications.
(is mostly incorrect.)
About checking for m.2 slot, Go to your motherboard on its website, and check Storage interface, this will tell you if you have an m.2 slot and use what I said above to know if its x2 or x4, and then buy what you need. This could also be in Expansion Slots.
(Correct me if I'm completely off, New to all this, but I like to think I have a decent idea on what I'm doing.)