With luck, you should never need to check your iPhone’s or iPad’s warranty status. But bad things do happen to good devices. In iOS 12.2, Apple has just made it easier to figure out if your device is still under warranty or covered by AppleCare+. Go to Settings > General > About, where you’ll find a new entry that’s either called Limited Warranty (the basic Apple warranty) or AppleCare+ (the extended warranty and insurance you can buy). The entry shows the expiration date, and tapping it provides more details on the Coverage screen. If your iPhone or iPad doesn’t have AppleCare+ but is eligible for it (within 60 days of purchase), you can even buy it from this screen. You won’t see anything if your device is out of warranty and no longer eligible for AppleCare+.
Unfortunately it’s not quite as easy to check the warranty on your Mac, though I suspect that they will add a similar feature to a future update. In the meantime, you can check your Mac’s warranty by visiting checkcoverage.apple.com and entering your serial number, which can be found in the menu > About This Mac.