Jesus knew that we would experience trials and sorrows in this world, He experienced them himself when he walked the earth. However, He gave us an escape from the pain with peace that only comes with knowing Christ and that He has everything under control.
Jesus tells us to "Take heart" because "I have overcome the world." Jesus is bigger than our trials and struggles. He is bigger than the sins of this world. He has overcome sin and death on the cross. By our faith in Jesus He will give us strength to overcome our own everyday struggles.
Because Jesus has overcome the world and sin, He has the ability to provide peace to all who believe in Him. Not just once in a while, not just after we die and enter heaven, but right now, today and everyday.
Take heart, Jesus has overcome the world and He will provide you peace for all of your days when you put your trust in Him.