Understanding Source Code of I2C communication
It seems to be very self evident, but that must be my confirmation bias ;D

First, the lines starting with // are Comments. Wholly For your benefit. As is any text after a # (which is not used here).

I2C Start hand shake
Write device's Address
Write device's configuration address
Write the higher byte of the configuration desired
Write the lower byte of the configuration desired.
I2C Stop hand shake

Wait a bit.

Start
write device address
switch to device's results address
stop

Start
Read from device address
if no error
read the first byte from the results
read the second byte
Stop.


Note the OPT3001 has 16 bit registers. That's two 8-bit Bytes. Standard i2c works in 8-bit bytes. So you have to read two bytes to get the full results. Typically, with a Most Significant Byte order, the higher bits (15-8) are called the high/first byte.

I2C works by addressing the device in write mode, telling it to change to a register/internal address, then writing or reading from that point. This device is no different. That's the basics of I2C