God is just the one who obeys him and suffer for him is the closest to him. That is why he tested Abraham to see if he would choose to obey God and sacrifice his son. That is why he chose him a close friend. The most of humans to suffer are the messengers. They did not only suffer from their enemies but even their followers when they would feel down or suspicious. Patience and praying were the most helpful to stand for sufferings. The sufferings came because the evil and corruption overpowered the good. It is not because of God but because the people who followed Satan outnumbered and overpowered those who are righteous. The two tests to humans are if they will praise God for his gifts (praising him and obeying his commands) and be patients when they are tested. Many times sufferings happen to cleanse our sins. Few people get suffering despite being good people. If you believe the high reward God kept for them you will accept that he is more than just. For sure more than thousands of folds (but they have to acknowledge him). I chose some of the verses that talk about patience and how it is so important to believers.
1- When God sent Moses he knew how Beno Israel will suffer. So he told Moses to remind them of the good days and how to be patient and constant: 14:5 We sent Moses with Our signs (and the command). "Bring out thy people from the depths of darkness into light, and teach them to remember the Days of Allah." Verily in this there are Signs for such as are firmly patient and constant,- grateful and appreciative. وَلَقَدْ أَرْسَلْنَا مُوسَى بِآيَاتِنَا أَنْ أَخْرِجْ قَوْمَكَ مِنَ الظُّلُمَاتِ إِلَى النُّورِ وَذَكِّرْهُمْ بِأَيَّامِ اللّهِ إِنَّ فِي ذَلِكَ لآيَاتٍ لِّكُلِّ صَبَّارٍ شَكُورٍ
2- God lists in another verse the sufferings that he test us with: 2:155 Be sure we shall test you with something of fear and hunger, some loss in goods or lives or the fruits (of your toil), but give glad tidings to those who patiently persevere, وَلَنَبْلُوَنَّكُمْ بِشَيْءٍ مِّنَ الْخَوفْ وَالْجُوعِ وَنَقْصٍ مِّنَ الأَمَوَالِ وَالأنفُسِ وَالثَّمَرَاتِ وَبَشِّرِ الصَّابِرِينَ
3- The best we can do to stand sufferings are to be patient and keep on praying: 2:153 O ye who believe! Seek help with patient perseverance and prayer; for Allah is with those who patiently persevere. يَا أَيُّهَا الَّذِينَ آمَنُواْ اسْتَعِينُواْ بِالصَّبْرِ وَالصَّلاَةِ إِنَّ اللّهَ مَعَ الصَّابِرِينَ
4- The reward to sufferings is the highest place in heaven: 25:75 Those are the ones who will be rewarded with the highest place in heaven, because of their patient constancy: therein shall they be met with salutations and peace, أُوْلَئِكَ يُجْزَوْنَ الْغُرْفَةَ بِمَا صَبَرُوا وَيُلَقَّوْنَ فِيهَا تَحِيَّةً وَسَلَامًا
5- For messengers and those who preach for righteousness they do what God inspired them to do and God is the one who will decide for the future: 10:109 Follow thou the inspiration sent unto thee, and be patient and constant, till Allah do decide: for He is the best to decide. وَاتَّبِعْ مَا يُوحَى إِلَيْكَ وَاصْبِرْ حَتَّىَ يَحْكُمَ اللّهُ وَهُوَ خَيْرُ الْحَاكِمِينَ