Electricity flows along a path called a circuit. When there is no obstruction to the path of the electrons, the circuit is complete and the light shines. When there's no obstruction to God's graces, the circuit is complete and His light is able to shine within us.
When we sin, we break the circuit. God's grace is still flowing but it's not able to make a connection with us and so our light isn't able to shine. Only through going to confession is God able to fix the broken wires, complete the circuit, and restore the shine.
Sometimes, we find that our light isn't shining as brightly as it used to. This is often because we are putting up resistance to His grace. Our circuits are complete, but there's something causing it to have more trouble reaching us. This is where prayer comes to the rescue. Prayer helps to clear out the obstacles that are in our path so the full force of God's grace can help us shine as brightly as we were made to shine.