Remove the left ear cushion by turning it counter-clockwise. The serial number (SN followed by an 8-digit number) can be found on the edge. To mount the ear cushion again, make sure to align the mark inside the headphone with the mark on the ear cushion and then turn it clockwise.
Alternatively, if your Beoplay H9 are added to the Bang & Olufsen app, you can also find the 8-digit serial number under "Product information -> Product settings -> About".