Jeremiah 42:15

And now therefore hear the word of the LORD, ye remnant of Judah; Thus saith the LORD of hosts, the God of Israel; If ye wholly set your faces to enter into Egypt, and go to sojourn there;

The verse belongs to Jeremiah 32-45, which records history from the two years before the fall of Jerusalem. Within that, chapters 40-45 fall near the end of Jeremiah's work in Judah in the proposed chronological order. It answers the remnant of Judah after they asked for God's direction through Jeremiah, but their asking was insincere because they wanted counsel that matched their own plans and did not truly intend to obey.

The verse warns the surviving remnant of Judah not to wholly and deliberately set their faces to enter Egypt to sojourn and live there, because doing so is against the Lord's command. Instead of going to Egypt, they were told to remain in the land under Babylonian rule, where obedience would bring protection. The remnant disobeyed the warning and went to Egypt, reaching Tahpanhes despite strong protest.

After disobeying, they accused Baruch of influencing the message, showing suspicion and unbelief toward God's prophet. Choosing Egypt against God's direction was futile and brought danger and destruction for that sin. There many turned to idolatry, and Egypt itself would be defeated by Nebuchadnezzar.