Think about the literary significance of John's account concerning Nicodemus. He reports, "This man came to Jesus by night" (John 3:2). It may not be evident upon one's first reading of this that "by night" is not just a time indicator concerning when Nicodemus came to Jesus. Given the prominence of the "light"/"darkness" motif in John's Gospel, surely the mention of "night" also describes Nicodemus's spiritual condition--at that time he was in spiritual darkness.
Yet, there surely is more that John is suggesting by telling readers that Nicodemus came to Jesus "by night." The darkness of night is often the cover evil people use to conceal their evil deeds. Yet, here, Nicodemus, a man who is yet in spiritual darkness uses the darkness of night to conceal not an evil act but a good act, his coming to Jesus.
Trace the other accounts of Nicodemus in John's Gospel to discover that he finally emerges into the light. He begins to move from darkness to light, daring to raise his voice in dissent within the Sanhedrin (John 7:50) and later, in the end, he even does a good act in daylight not at night by assisting Joseph of Arimathea to receive and to bury the corpse of the Christ (John 7:50; 19:39).