The Son of Man was a title Jesus applied to himself. As such, most New Testament mentions of this phrase are found in the four gospels.
Jesus used this phrase euphemistically. His close followers likely understood it to mean the Son of God, yet his adversaries (the Jewish leaders) were in the dark.
It’s likely that had he publicly called himself the Son of God, he would have been quickly executed for blasphemy. In fact, he was killed only hours after he admitted to being the Son of God (Luke 22:70).
The phrase son of man is also found in the Old Testament, mostly in the book of Ezekiel, seemingly as a pet nickname that God called Ezekiel.
However, Daniel records that “In my vision at night I looked, and there before me was one like a son of man, coming with the clouds of heaven” (Daniel 7:13). Jesus likely took his title, the Son of Man, from this verse.