Luckily, you can back your data up now (should be anyway), and just buy a NOS replacement SSD of whatever size you want, (I picked up a 1tb for about 300 and then a 2tb for 400, & if you’re qualified to operate a screwdriver, pop it in, restore from backup, & you’re back in action. Don’t even wait til the catastrophic failure, you’ve already got your warning that the time to toss the old SSD is now. Unlike the new models, which just go in the trash at that point (bc the entire logic board has to come from Apple which is more than the entire machine is worth), just consider changing out SSD’s with their limited lifespan to be like changing the timing chain on a car. These classic iMacs are designed to be serviceable & will run for ages with minimal (but important) periodic maintenance.
Search eBay for Polariss SSD. The 2015 iMacs run just fine on the 2015 generation SSD models and even faster on the 2019 models, boot camp & all. You take your chances with other aftermarket SSDs like WD Blacks & things, bc even though you think you’ll save $ over the Polariss, the firmware may not recognize the WD’s, & then refuse a boot camp installation or even & boot OSX poorly. This is the one area it pays to stick with the slightly pricier OEM hardware. But buying it from Apple will cost 2-3x as much, for absolutely no benefit.
Tye tutorial on how to access the SSD on your logic board is on OWC’s site, which walks you through it slowly and thoroughly. It seems daunting the first time, but when things become familiar, you can do it in about 10min and the sense of accomplishment of having taken it completely apart (& cleaned it all out) is fantastic.