The “Problem of Evil” is a problem for atheists, not believers.
Atheists have to explain how murderers and tyrants can get away with all their crimes while living comfortable lives without facing any consequences for their crimes.
As for how God could allow suffering and pain in this world despite his power, this is easy to address. The Prophet ﷺ gave us the answer in numerous hadith. For instance:
“If the dunya to Allah was worth as much as even a mosquito’s wing, then He would not allow the disbeliever to have a sip of water from it.”
حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا عَبْدُ الْحَمِيدِ بْنُ سُلَيْمَانَ، عَنْ أَبِي حَازِمٍ، عَنْ سَهْلِ بْنِ سَعْدٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم “ لَوْ كَانَتِ الدُّنْيَا تَعْدِلُ عِنْدَ اللَّهِ جَنَاحَ بَعُوضَةٍ مَا سَقَى كَافِرًا مِنْهَا شَرْبَةَ مَاءٍ ”
Bask in the radiance of the Messenger’s words!
If this worldly life was worth anything or had any lasting significance, no evil person would get to even enjoy a sip of water. The fact that evil people are enjoying much more than this means that the world is worth even less than a single wing from a single mosquito. If that is the level of worthlessness of the entirety of the dunya, then anything less than that is worth even less and is even more insignificant. That means that any pain, joy, sadness, or happiness experienced in the dunya is of such vanishing significance in comparison to the hereafter.
Only for those who believe the dunya is all that there is and they have overexaggerated the significance of the dunya does worldly evil cause existential doubt and despair (that they have to drown out with regular doses of heedlessness, i.e., ghaflah). For those who remember and mention Allah, however, their hearts are perfectly content.
May Allah rectify our hearts!