Make sure that Bluetooth is enabled on your iPhone or iPad. You can do this via Control Center or the Settings menu. With the AirPods inside your case, hold it near the iPhone or iPad and open the case. A pop-up should appear on your device showing the battery life of the AirPods and their case.
Open the lid of your AirPods case or take your AirPods out of the case. Click the Bluetooth icon in the menu bar of your Mac. Hover the pointer over your AirPods in the menu. You will see the battery life displayed.