Trials give opportunities to show our faith. People who are doing well are easy targets.
Prayer has three P's: praise, promises, and petition. When we are in trials and we are angry with God, our praise is a sacrifice which can dissolve our anger. Stating the promises of God builds our faith and changes doubt into expectancy. We can then base our petition on His promises and end our prayer with a praise that is full of faith and thanksgiving.
God is patient with our accusations and spiritual tantrums; for we are learning how to communicate with Him. This is not a formula for prayer. It is a model.