The Last Judgment will take place after the resurrection of the dead. Jesus Christ Himself will judge all people: "When the Son of Man comes in His glory... all the nations will be gathered before Him" (Mt 25:31-32). God will publicly reveal the truth about each person—their good and bad deeds, and even what remained hidden: "God will judge the secret actions of men" (Rom 2:16).
This will not be because God needs to learn anything—for He knows our hearts perfectly—but rather to manifest His justice before all. "We must all appear before the judgment seat of Christ" (2 Cor 5:10). "Those who have done good will rise to life, and those who have done evil will rise to condemnation" (Jn 5:29).
Then Christ will definitively separate the righteous from the sinners (Mt 25:33) and pronounce the eternal sentence: "Come, you who are blessed by my Father" (Mt 25:34), or "Depart from me, you who are cursed" (Mt 25:41).

