This last judgment section is unique to Matthew. Jesus said that the king turned to those goats on his left side (τότε ἐρεῖ καὶ τοῖς ἐξ εὐωνύμων). He wanted these goat people to leave him and go away (Πορεύεσθε ἀπ’ ἐμοῦ). He called them cursed (κατηραμένοι). They were to go into the eternal fire (εἰς τὸ πῦρ τὸ αἰώνιον) that had been prepared for the devil and his angels (τὸ ἡτοιμασμένον τῷ διαβόλῳ καὶ τοῖς ἀγγέλοις αὐτοῦ). They were to depart from the king and be cursed to join the devil and his angels in the eternal fire that had been prepared for the devil. Thus, we have the basis for the classic Christian teaching of eternal heaven with God, the Father, Jesus, the Son, and the Holy Spirit for the righteous or the eternal fire of hell with the devil and his companions for the evil or wicked people. This was the final judgment awaiting all people.
Jesus said that the judgment end times was coming soon. Something similar can be found in all 3 synoptic gospels, Mark, chapter 9:1, Luke, chapter 9:27, and here, almost word for word, especially the second verse. Jesus said that the Son of Man was going to come (μέλλει γὰρ ὁ Υἱὸς τοῦ ἀνθρώπου ἔρχεσθαι) in the glory of his Father (ἐν τῇ δόξῃ τοῦ Πατρὸς αὐτοῦ), with his angels (μετὰ τῶν ἀγγέλων αὐτοῦ), a clear indication of the end times. Then the Son of Man would repay or judge everyone for what they had done (καὶ τότε ἀποδώσει ἑκάστῳ κατὰ τὴν πρᾶξιν αὐτοῦ), the judgment day. Then in a solemn pronouncement (ἀμὴν λέγω ὑμῖν) Jesus said that some of those standing before him would not experience or taste death (ὅτι εἰσίν τινες τῶν ὧδε ἑστώτων οἵτινες οὐ μὴ γεύσωνται θανάτου) before they would see the Son of Man coming in his kingdom (ἕως ἂν ἴδωσιν τὸν Υἱὸν τοῦ ἀνθρώπου ἐρχόμενον ἐν τῇ βασιλείᾳ αὐτοῦ). The end times or judgment was imminent, not some far away time.
Only Matthew has this explanation about the parable of the weeds, in chapter 13:24-30. Here it is the harvest time, the end times, when the Son of Man would send out his angel reapers or messengers (ἀποστελεῖ ὁ Υἱὸς τοῦ ἀνθρώπου τοὺς ἀγγέλους αὐτοῦ). These angels or harvesters would collect and gather out of his kingdom (καὶ συλλέξουσιν ἐκ τῆς βασιλείας αὐτοῦ) all the snares or causes of sin (πάντα τὰ σκάνδαλα), the sinners, and those practicing unlawfulness (καὶ τοὺς ποιοῦντας τὴν ἀνομίαν), the evil ones. Then these angel reapers would burn them like the weeds in the parable. They would throw them into the furnace of fire (καὶ βαλοῦσιν αὐτοὺς εἰς τὴν κάμινον τοῦ πυρός), where there would be weeping or lamenting and gnashing or grinding of teeth (ἐκεῖ ἔσται ὁ κλαυθμὸς καὶ ὁ βρυγμὸς τῶν ὀδόντων). This later was the normal form of mourning or behavior of those who were upset or frustrated. The evil weeds would be allowed to grow with the good grain until the end times of the harvest. However, the evil weeds or the evil doers would suffer in fire and frustration as their final reward at the harvest end times.