An SSD has generally 2 different form factors (overall types):
Then the M.2 drive has 2 different interfaces (how it communicates with the PC):
An NVMe drive is a PCIe interface M.2 and can only be used in M.2 sockets that are also PCIe based.
There are also general PCIe M.2s that aren't labelled NVMe but also need a PCIe M.2 socket.
A standard SATA based M.2 requires an M.2 socket that is also SATA based.
Generally NVMe is faster as PCIe bandwidth is much bigger (faster data transfer) but in real world terms, the difference for applications is negligible as the application can only use the data so fast anyway.
The numbers (such as 2280) you see after an M.2 name or in the spec sheet is then the physical size of the M.2 (length). Then there are the keys.
Here is a quick idea for the keys
B key = PCIe x2 / SATA
M Key = PCIe x4 / SATA
A B+M is a keythat can operate with both.
Also just be wary of the interface you are using - see point 5 here:
https://forums.tomshardware.com/thr...when-selecting-parts-for-a-custom-pc.3510178/