Here is a way to think about it that might help:
If you believe that God is infinite and he is the source of all good things then even in the most difficult times you won't lose your faith.
This is because the nature of the good is solely to do good. This means that everything that comes from the source of good is in truth actually good.
Just like a little baby cries when his mom wipes hims. It is painful and un-pleasant but it's for the baby's on good and his mother is simply cleaning him up because she loves him so much.
In a very similar way, since we are finite and god is infinite it is hard for us to tell what is truly good for us. Most times it turns out that at the end of the day (and sometimes this takes an awfully long period of time) all the difficult things that happened to us are in fact the best things that ever happened to us. It is very hard to recognize how such things are really good for us when they are actually happening because it is so painful and many times we cannot see any way out. However if you remember that god is doing to do and since he is the very source of all good he is only doing it for your good, if you hold strong onto your faith and trust him that he is doing it for your very best, then you will have a much easier time overcoming even the most difficult times.
Did you find this post helpful?
Related Questions: How do you keep your faith when life seems hopeless?