Consider it pure joy, my brothers, whenever you face trials of many kinds, because you know that the testing of your faith develops perseverance.
James is one of the most difficult books of the Bible to follow because it contains some of the hardest principles to live by. James, the brother of Jesus, was the head of the early church and was likely addressing problems that had appeared in numerous churches.
Although it is not our natural inclination to be joyful when we suffer hardships, we would do well to remember that it is through suffering that our faith is grown. We are not challenged and our faith is not strengthened when everything is going right in our life.
By enduring hardships, we will develop perseverance. Some people self righteously survive hardships and boast about their strength afterwards. Christians know that this is not the case however.
When we endure hardships, we know that it is God who sees us through suffering. As long as we remember this, our faith is strengthened and we will be better able to deal with the next trial that we may face.