Apple or an Apple Authorized Service Provider (AASP) will replace affected hard drives free of charge. Apple is contacting affected iMac owners who provided a valid email address during the product registration process to let them know about this program.
If you have not been contacted, but think you have a 3TB hard drive, you can enter your serial number at the link below to see if it's part of this program.
Apple recommends replacing affected hard drives as soon as possible. You can do this at an Apple Retail Store, an Apple Authorized Service Provider or through Apple Technical Support.