Nicodemus appears only in John’s Gospel. He was a Pharisee, a group who were fastidious in keeping the letter of the Law and often opposed the Lord throughout His ministry. He was also a member of the Jewish Ruling Council, the Sanhedrin.
Under Roman authority at the time of Christ, the Jewish nation was allowed a measure of self-rule, and the Sanhedrin in Jerusalem was the final court of appeal for matters regarding Jewish law and religion. This was the body that ultimately condemned the Lord to be crucified, yet they had to get Pilate to approve their sentence since the death penalty was beyond their jurisdiction under Roman law.
Being a Pharisee and a member of the Sanhedrin one can understand why Nicodemus went to Jesus at night. Why did he want to see Jesus and what did he learn?