For I know the plans I have for you, declares the LORD, plans for welfare and not for evil, to give you a future and a hope.
What we are not as familiar with is the context. God prophecies through Jeremiah that while He has plans to prosper them, they first have to endure 70 years of exile in Babylon.
 Then you will call upon me and come and pray to me, and I will hear you.  You will seek me and find me, when you seek me with all your heart.  I will be found by you, declares the LORD, and I will restore your fortunes and gather you from all the nations and all the places where I have driven you, declares the LORD, and I will bring you back to the place from which I sent you into exile.
(Jeremiah 29:11-14 ESV)
There are some very important things we need to see in this passage. First of all, notice that in verse 14, God says that He drove them out from Israel, claiming responsibility for the troubles the exiles were facing.
The next important piece we need to look at is verses 12 and 13, where the almighty God explains Himself through Jeremiah. He tells His people that they must go into exile for 70 years until they learn to once again seek after Him with all of their hearts. But God also gives them comfort, telling them that they would learn the lesson, and that he would bless and prosper them once they returned to Him. 70 years later, Daniel realizes that the time has come for the Lord to bring His people back into Israel and begins to pray in atonement. His prayer is answered by the angel Gabriel, who brings him news of the future, including Israel's restoration to the land, as well as information concerning the end of days.
God fulfilled the promise He made through Jeremiah.
There are a lot of teachers out there in the world today claiming that since God loves us, He would never do anything to hurt us or cause us pain. They tell us that if something bad or painful happens, it's the work of satan, and not God's Will.
In this passage from Jeremiah, we see definitely that this is not so. God caused the people of Israel to suffer, both for punishment and instruction.
The Bible also tells us that God uses suffering and affliction to test us.
 Count it all joy, my brothers, when you meet trials of various kinds,  for you know that the testing of your faith produces steadfastness.  And let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing.
 If any of you lacks wisdom, let him ask God, who gives generously to all without reproach, and it will be given him.
(James 1:2-5 ESV)
[8:1] “The whole commandment that I command you today you shall be careful to do, that you may live and multiply, and go in and possess the land that the LORD swore to give to your fathers.  And you shall remember the whole way that the LORD your God has led you these forty years in the wilderness, that he might humble you, testing you to know what was in your heart, whether you would keep his commandments or not.  And he humbled you and let you hunger and fed you with manna, which you did not know, nor did your fathers know, that he might make you know that man does not live by bread alone, but man lives by every word that comes from the mouth of the LORD.  Your clothing did not wear out on you and your foot did not swell these forty years.  Know then in your heart that, as a man disciplines his son, the LORD your God disciplines you.
(Deuteronomy 8:1-5 ESV)
 Blessed be the God and Father of our Lord Jesus Christ! According to his great mercy, he has caused us to be born again to a living hope through the resurrection of Jesus Christ from the dead,  to an inheritance that is imperishable, undefiled, and unfading, kept in heaven for you,  who by God's power are being guarded through faith for a salvation ready to be revealed in the last time.  In this you rejoice, though now for a little while, if necessary, you have been grieved by various trials,  so that the tested genuineness of your faith—more precious than gold that perishes though it is tested by fire—may be found to result in praise and glory and honor at the revelation of Jesus Christ.
(1 Peter 1:3-7 ESV)
 Beloved, do not be surprised at the fiery trial when it comes upon you to test you, as though something strange were happening to you.  But rejoice insofar as you share Christ's sufferings, that you may also rejoice and be glad when his glory is revealed.
(1 Peter 4:12-13 ESV)
God will not only allow suffering, He will cause it to fulfill His purpose. Here's a question for you. If you always reward your children with love and affection, and never apply discipline, what kind of children do you raise?
We call them spoiled, and it's a good word. They develop no strength of character, no regard for the feelings of others, showing only a selfish desire to have their own wants and needs met.
To combat that, to raise good strong children who will grow to be strong worthy adults, we discipline our kids. We instruct them, and when they don't heed our instruction, we reinforce our lessons with consequences. While many of us like to believe we can reason with our children, that if we explain things in a way that they can understand, then they will always make the right choices. As we gain experience as parents, we learn that this is a pipe dream. Children don't always respond logically or rationally, and they aren't always equipped to decide the correct response.
When a child strays into a busy street, he doesn't evaluate the chances of getting hit by a car; he just wants his ball back. A long lecture won't change that. However, a swat on the rear or other painful consequence will make an impression that goes beyond logic or reason. Positive feedback is important, but there are occasions when only negative feedback will work when raising a child.
So let's look back at Deut 8:5. Moses writes that God will discipline us as a man disciplines his son. And sometimes, we require some negative feedback. Our great good fortune is that God is merciful, and HIs Grace ensures that we don't receive the full amount of negative feedback we deserve.
Whether it is to test us, to help us grow in faith and strength, to reprove us, or instruct us, our job is to realize that when we suffer, it is a part of God's plan for us, and that means that it will work for our good, even though we may not know how.