Different situations can cause pain and people in pain can be looked down on. God is not happy with proud people but draws close to the humble. Proud people think they have no need for God but a broken person and their circumstances can feel a little alone or guilty but more open to seeking Gods council and what he has to say. We have assurance that God is in complete control. In difficult times we can then become closer to God and also be used in his kingdom. Jesus knew his Father and that he could trust him.
Wrong thoughts can put us in a position like David in Psalm 51, he was in a broken place where he admitted he had sinned. His prayer started with acknowledging God and that God could forgive him. He knew that God sees everything and that his punishment is just. Even in our worst times God will see it. David asked God for a new clean heart and that God would not take the Holy Spirit away.
All of Gods purposes are for good and never for evil. Let us also ask God for the Holy Spirit and even in trials we can praise God as he will be with us. God said that David was a man after his own heart. Willingness to change will fade and so we need God. Let our hearts cry to the Lord be sincere, let us repent as God can cleanse us. David knew the Lord well as he always looked for God and council in his Word. There is no shame left when God forgives you. Go to him with a sincere heart.
Psalms