In the third year of the rule of Judah's King Jehoiakim, Babylon's King Nebuchadnezzar came to Jerusalem and attacked it.
References for Daniel 1:1
The Lord handed Judah's King Jehoiakim over to Nebuchadnezzar, along with some of the equipment from God's house. Nebuchadnezzar took these to Shinar, to his own god's temple, putting them in his god's treasury.
Nebuchadnezzar instructed his highest official Ashpenaz to choose royal descendants and members of the ruling class from the Israelites—
References for Daniel 1:3
good-looking young men without defects, skilled in all wisdom, possessing knowledge, conversant with learning, and capable of serving in the king's palace. Ashpenaz was to teach them the Chaldean language and its literature.
The king assigned these young men daily allotments from his own food and from the royal wine. Ashpenaz was to teach them for three years so that at the end of that time they could serve before the king.
Among these young men from the Judeans were Daniel, Hananiah, Mishael, and Azariah.
But the chief official gave them new names. He named Daniel "Belteshazzar," Hananiah "Shadrach," Mishael "Meshach," and Azariah "Abednego."