If the drive is failing, then you shouldn't be installing to it in the first place.
You NEED to test the drive, using Seatools for DOS.
https
/www.seagate.com/support/downloads/seatools/
Or for Windows if you have another system you can temporarily attach that drive to for testing. There are both versions at that link.
IF the drive passes the Short DST (Drive self test) AND the Long generic (Long generic will take several hours to complete) THEN you can install Windows to the drive using the following method, if it is Windows 10 you are trying to install. If it is another version, there are other tutorials you can use.
Windows 10 Clean install tutorial
Installing to a failing drive would be a waste of time anyhow. It's possible you may NEED to get a new drive if that one is in fact failing. There is nothing you can do to get around this if it's true.