If you plan on removing the screen of a iMac to replace a drive, you should do enough research to figure out what kind of drive will be compatible with it! 🤔
This is a very moderm premium PCIE 4.0 drive, I would not waste it on a device from 2015.
If you really want M.2 (and you know how to get to it inside the mac), go for a cheaper PCIE 3.0 drive, you will see no difference.
If what died was a SATA drive, just replace that one with a cheaper SATA SSD and save even more money, and you will probably still not see the difference.
This video shows how to access the SATA SSD and it looks painfully hard, would not recommend 😨
https://www.youtube.com/watch