A man claiming to be a prophet of God announced that Babylon was soon to be defeated. The Lord informed Jeremiah that not everyone who claims to be speaking the word of God is.
The exiles aren't where they want to be. They have lost their home. They are surrounded by strangers. And they are going to be there a lot longer than they had hoped.
The prophet Jeremiah sent them a message, "Build houses and live in them; plant gardens and eat what they produce." In time of loss and despair, they are told to take care of themselves--to find shelter and food, what's needed for refuge and sustenance.
And, they need to recognize that this isn't going to be like a camping trip or even a long journey. He also tells them to get married, and that they will still be in this foreign land when it's time for the children born from these marriages to get married themselves.
Shelter, food, and family. Not hopeless yearning for what was but isn't. Not exactly acceptance but a way to continue under unwanted circumstances.
Then Jeremiah adds another directive, "Seek the welfare of that foreign city and pray to the Lord on its behalf, for in its welfare will be your welfare."
We can apply this prophecy to our own lives in different ways depending on whether our current situation is more like that of the exiles or more like that of the Babylonians.