Jesus said, "I am the light of the world." And we know that "In Him there is no darkness at all."
Also, in the first part of the passage I am referring to Jesus said ,"You are the light of the world." ( I believe he was talking to his disciples here.)
We know as believers we have the very life of Christ alive within us. His Spirit is one with ours. He is light! We have His light inside of us! When we "let go and let God" or rest in Him, or walk by the Spirit, we are letting our light shine. I think He wants us to get comfortable with this and let it shine everywhere we go! Letting our light shine, is another way we die to our right to be in control and let Him live the life! We need to know this truth of, Christ in us, the hope of glory. We need to really truly embrace it as a deep heart understanding, else we miss out on many meanings of many Scriptures. When we know it's Christ in us, we know that the light that we shine is Him. Not our trying to behave well to impress non-Christians. Anyone can be moral enough and behave and show kindness enough to impress someone!! I know lots of moral unsaved people and their kindness outdoes that of many Christians! So how could we think for one second this verse has to do with our behavior or our good efforts to look like Jesus to a lost and dying world. If we truly know it's Christ in us, His light, and we appropriate that truth and let him live through us, the good works we do are the works that Jesus is doing through us. Not us doing the works out of our flesh, those would be dead, dung, rubbish!! They will burn! No, it's Christ in us, working through us. The only works that will please the Father are Jesus' works! All our attempts and efforts at works are like filthy rags. If we are to do the works that Jesus did, we must let Him do them, through us! He initates, we respond!!
So, when we do this, letting our light shine so that they (the lost world) may see our good works and give glory to God in heaven - we are pointing the world to Jesus! When they see Jesus in us, they will give glory to God!! Remember wherever Jesus went, whatever miracles he did, people were amazed and many believed, many rejoiced and praised God, as well as put their faith in Jesus! (I say many, because unfortunately there were those who were angry and jealous of Jesus, the Pharisees, the self-driven and self-righteous ones who wanted credit for all there hard work and living up to the high standards of the law, they wanted to be glorified instead of God!!)
So, it's Christ in you - believer, shining His light through you, before others so that they may see the good works that Jesus will do through you, and glorify our Father in Heaven!!!! We have the life of Christ in us, for us to share with the whole world!! Let's let them see our light!!