Do I feel close to God when I’m in pain?

Or do I feel separate and distant from God when my heart is broken?