9 Nicodemus said to him, “How can these things be?” 10 Jesus answered him, “Are you the teacher of Israel and yet you do not understand these things? 11 Truly, truly, I say to you, we speak of what we know, and bear witness to what we have seen, but you do not receive our testimony. 12 If I have told you earthly things and you do not believe, how can you believe if I tell you heavenly things? 13 No one has ascended into heaven except he who descended from heaven, the Son of Man. 14 And as Moses lifted up the serpent in the wilderness, so must the Son of Man be lifted up, 15 that whoever believes in him may have eternal life.
John 3:9–15

In the first part of the conversation with Nicodemus, Jesus speaks of what must be done to Nicodemus. In the second part of the conversation, Jesus speaks of what must be done for Nicodemus. Man must be born from above. The Son of Man must be lifted up. The Spirit must cause regeneration. The Son must accomplish redemption.
The transition from the work of the Spirit in Nicodemus to the work of the Son for Nicodemus happens with Nicodemus’ clumsy question, “How can these things be?” Jesus both rebukes and then answers Nicodemus’ question.
“You must be born again.”
“How can these things be?”
“The Son of Man must be lifted up.”
The lifting up of the Son of Man is the how behind man’s being born from above. Regeneration is the Spirit’s application of the redemption accomplished by the Son. Because of the dying of the Son of Man, the Spirit makes men alive.
For man’s salvation, man needs the work of Christ for Him, and the work of the Spirit in Him. The Spirit must renew. For the Spirit to renew, the Son must be lifted up. The Son of Man was lifted up. Thus, the Spirit causes men to be born from above. And behind both the sending of the Son to redeem and the sending of the Spirit to renew is the love of the Father.
Here is how Paul spoke of these things in Titus 3:4–7.
“But when the goodness and loving kindness of God our Savior [referring to the Father] appeared, he saved us, not because of works done by us in righteousness, but according to his own mercy, by the washing of regeneration and renewal of the Holy Spirit, whom he poured out on us richly through Jesus Christ our Savior, so that being justified by his grace we might become heirs according to the hope of eternal life.”