I think those are the best situation with which to apply that quote because, as you stated, you would never logically chose that situation. Using the example of a close friend dying, this is of course, a terrible and traumatic thing. It is also something that you cannot change. You can only change things that you have control of. So, imagine, in a fantasy world, why would you chose those circumstances? Perhaps, your friend gave you good advice that you were never brave enough to follow through on. Perhaps his death gave you new perspective on what is truly important to you, ect..
Does that make sense?
Think of this statement from the perspective of "nothing is good or bad. It just is". This quote helps to strip away our inherent prejudices towards circumstances that we label as "good" or "bad".