safer to install onto m.2 first incase you have any hassles, at least then the ssd still works
remove ssd from PC and only have m.2 installed
boot from installer
follow this guide:
https://forums.tomshardware.com/faq/how-to-do-a-clean-installation-of-windows-10.3170366/
once PC boots fine from M.2, reattach ssd and make sure its not listed in boot order
Copy anything on ssd you want to keep onto m.2
go to settings/update & security/recovery
under advanced startup, click restart now button
Pick troubleshoot
Pick advanced
Pick Command Prompt
Type
diskpart and press enter
Type
list disk and press enter
This will show the list of drives currently attached to PC, make note of the drive number of the drive you want to wipe
If Disk 1 is the drive you want to clear, type
select 1) and press enter. A message will confirm it is selected
Warning: Diskpart Erase/Clean will permanently erase/destroy all data on the selected drive. Please be certain that you are erasing the correct disk.
Once you sure its right disk, type
Clean and press enter
The Command Prompt window will display the message "DiskPart succeeded in cleaning the disk". Close out of the Command Prompt window by clicking the red X in the upper right hand corner.
restart PC and then run disk management to format ssd so you can use it again.