If we say that we have fellowship with Him, and walk in darkness, we lie, and do not (don’t practice) the truth – 1st John 1:6
Light represents what is good, pure, true, holy and reliable when darkness represents sin and evil. Light is also related to truth, it exposes whatever exists, whether it’s good or bad. Just as darkness can’t exist in the presence of light, sin can’t exist in the presence of a holy God.
In order to have a relationship with God, we must put aside our sinful ways of living, and we can only do that by knowing what the word of God states what is sin in the eyesight of God. To profess that we belong to Him, but live according to our desires is hypocrisy. We can’t live a life of practicing sin and have fellowship with God, and if we continue in our sin although we think its hidden from others, He will expose the sin through those with discernment. God will always give an individual ample enough time to stop. He’s long-suffering and merciful, but He doesn’t like hypocrisy.