What is the meaning of Matthew 6:22-23?

22 The light of the body is the eye: if therefore thine eye be single, thy whole body shall be full of light. 23 But if thine eye be evil, thy whole body shall be full of darkness. If therefore the light that is in thee be darkness, how great is that darkness! (Matthew 6:22-23 KJV)

William Burkitt’s Commentary

In the foregoing verses, our Saviour acquainted us what in our affections and judgments we should esteem as our chief treasure: now this judgment concerning our chief treasure, is by our Saviour here compared to the eye; as the eye is the candle of the body, that enlightens and directs it, so our understanding and judgment of the excellency of heaven, and the things above, will draw our affections towards them, and quicken our endeavours after them.

Note thence, that such as our judgment is concerning happiness, such will our desires and endeavours be for the attainment of that happiness. Our affections are guided by our apprehensions; where the esteem is high, endeavours will be strong.