The stone that the builders rejected has become the cornerstone. This is the Lord’s doing; it is marvelous in our eyes.” (Psalm 118:22–23, ESV)

The Zondervan NIV Study Bible says the cornerstone is: “The first stone set in a building project. It is the most important stone because it determines the direction of the walls (length and width) and establishes plumb for the walls (height).”  In other words, the cornerstone is crucial to the whole building, it is put in place first and sets the tone for everything that follows.  Without it, the building would not be able to stand.
Unsurprisingly, the writers of the New Testament see in this verse a metaphor for Jesus.  Indeed, Peter will echo the verse when preaching:

This Jesus is the stone that was rejected by you, the builders, which has become the cornerstone. And there is salvation in no one else, for there is no other name under heaven given among men by which we must be saved.”” (Acts 4:11–12, ESV)

Jesus was rejected, overlooked, scorned, despised, spurned, disdained, and loathed, by the Jewish leadership; and made the cornerstone of the church that God was building for his own glory and honor, by God himself.