Step 1: Determine the total number of valence electrons for O2. Each oxygen atom has 6 valence electrons, and there are 2 oxygen atoms, so 6 + 6 = 12 valence electrons.
Step 2: Draw the molecular orbital diagram for O2. Place the 12 valence electrons in the appropriate molecular orbitals.
Step 3: Identify the number of bonding electrons. In O2, there are 10 bonding electrons in the bonding orbitals.
Step 4: Identify the number of antibonding electrons. In O2, there are 2 antibonding electrons in the antibonding orbitals.
Step 5: Use the bond order formula: (number of bonding electrons - number of antibonding electrons) / 2.
Step 6: Plug in the numbers: (10 - 2) / 2 = 8 / 2 = 4.