It was not up to Nicodemus, nor is it up to any other person, to earn salvation; it is the work of God. Notice what Jesus told Nicodemus; He said that he "must be born again" (Jn. 3:3, 7). He said that salvation is the work of the Holy Spirit (Jn. 3:5, 8). Elsewhere in John's Gospel, we find out how the Holy Spirit brings about the new birth (Jn. 1:12; 3:13-18; 14:26; 16:7-14; etc.). So, the answer to man's question, "What must I do to be saved?" is believe the Holy Spirit!
The Holy Spirit convicts:
John 16:9 - of sin - Salvation is the result of believing that I am a sinner in need of a Savior (Rom. 3:23; 5:8; 6:23; etc.).
John 16:10 - of righteousness - Jesus offered Himself to be our Savior (Jn. 1:11-12; 3:13-18; 10:15-18; etc.). He died as payment for our sin, but God raised Him from the dead, and He ascended to heaven (Jn. 14:1-6; Acts 1:9; 1 Cor. 15:1-10; etc.).
John 16:11 - of judgment - We have a choice: we can believe what the Holy Spirit tells us through the Gospel, or we can face certain judgment for our sins (Heb. 10:27; Rev. 20:11-15; etc.).
What must I do to be saved? Believe the Bible: "But what saith it? The Word is nigh thee, even in thy mouth, and in thy heart: that is, the Word of faith, which we preach; that if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised Him from the dead, thou shalt be saved. For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation" (Rom. 10:8-10).
The work of salvation is completed by God; our "job" is to believe it!