3 …we also rejoice in our afflictions, because we know that affliction produces endurance, 4 endurance produces proven character, and proven character produces hope. 5 This hope will not disappoint us, because God’s love has been poured out in our hearts through the Holy Spirit who was given to us. (Romans 6:3-5 CSB)
Character is built by chiseling away all the unnecessary stuff and revealing what lies beneath. This chiseling can be painful at times as it may come in the form of afflictions we must endur. But make no mistake, God uses every aspect of our lives to show his love and make us better.
It may not feel that way while we are being chiseled away at, but God has purpose in everything. Even when we cannot see purpose in the trials we may be enduring.
Know, regardless, that God is there in your pain working to reveal a character trait you may not know you need.