How to Have Joy When You’re Suffering t he Impossible

The Bible says to count it all joy but how do you do that when you are suffering? When it is would seem impossible, what does this look like?