Apple have a number of free repair programs for faulty devices. Apple don’t communicate this directly to users of the affected devices so it’s good to occasionally go to their website and check your Apple devices. The repair programs do not run indefinitely.
The list includes the SSD drive and battery on some 13 inch macbook pros, the faulty butterfly keyboards on some new macbook pros, the iPhone 8 logic board, iPhone 7 coverage issues, battery replacement for iPhone 6s, the Beats Pill XL Speaker and more.
To see if your device is affected you can go to Apple’s repair program website and type in your serial number.