Jesus was just teaching about believers being the light. He told them, “You are the light of the world” (v14). Then he explained that people don’t hide a light under a bowl but they put it out so everyone can benefit from the light which shines.
It is in this context that He tells His followers to let their light shine before men. There is something we should notice here and it is this; Jesus is connecting our light shining with doing good deeds, and, it is the shining light of good deeds which causes mankind to give praise to Father God.