To start with, we can clearly see that the difference between MgO and MgS is the anions, we have O(2-) and S(2-). As we know (from looking at the periodic table) O(2-) has a smaller ionic radius, and thereby higher charge density than S(2-), as it has the same charge but packed into a smaller space. As a result, O(2-) will form stronger electrostatic attractions i.e. ionic bonds to Mg(2+) due to the smaller ionic radius and higher charge density, thereby MgO will have a more exothermic lattice enthalpy due to the stronger ionic bonds relative to MgS.