This video guide shows how to install Windows 10 on a M.2 PCIe SSD. It's a few years old but still applies well to most desktop systems and SSD's.
This video is just about installing Windows only. If you need to learn how to install the M.2 SSD hardware, then see this guide.