The Apple Watch Series 8 uses a variety of sensors to recognize when you’re sleeping. These include an accelerometer and a heart rate sensor.