Short answer
Both. A believer loves Allah above all, hopes for His mercy and fears His punishment. The Quran praises those who call on their Lord "in fear and aspiration" (32:16). Fear keeps you away from sin, hope keeps you from despair, and love is what moves both.
Fear (khawf) and hope (raja) are both required. al-Aqida al-Tahawiyya teaches that feeling safe from Allah's punishment and despairing of His mercy both lead away from Islam, and the way of truth lies between them. Loving Allah more than anything else is part of iman.
The four schools agree on this.
Explanation
Fear of Allah in Islam is not the fear you feel of a cruel person. It is awe of His greatness and fear of displeasing Him or facing His justice. It works like a fence: it keeps you from walking off a cliff. This is close to what the Quran calls taqwa. See What is taqwa?
Love comes first in rank. "Those who believe are stronger in love for Allah" (2:165). And love has a sign: "If you should love Allah, then follow me, so Allah will love you and forgive you your sins" (3:31). A believer loves Allah for His perfection and His countless gifts, and wants to be near Him.
The Prophet ﷺ visited a young man who was dying and asked how he felt. He said he hoped in Allah and feared for his sins. He said these two never meet in a servant's heart at such a time without Allah giving him what he hopes and making him safe from what he fears (Ibn Majah, graded hasan). He also said that if the disbeliever knew all the mercy with Allah, he would not despair of Paradise, and if the believer knew all the punishment with Allah, he would not feel safe from the Fire (Sahih al-Bukhari).
Scholars compared fear and hope to a bird's two wings, with love as its head. When you are healthy and tempted, let fear be a little stronger so it holds you back. When you are near death or crushed by guilt, let hope lead. If you only fear, you burn out; if you only hope, you grow careless. Read How merciful is Allah? and How can I get closer to Allah?
The evidence
Quran, Surah As-Sajda 32:16
تَتَجَافَىٰ جُنُوبُهُمْ عَنِ ٱلْمَضَاجِعِ يَدْعُونَ رَبَّهُمْ خَوْفًۭا وَطَمَعًۭا وَمِمَّا رَزَقْنَٰهُمْ يُنفِقُونَ ﴿١٦﴾
They arise from [their] beds; they supplicate their Lord in fear and aspiration, and from what We have provided them, they spend.
Praises believers who combine fear and hope.
Quran, Surah Al-Baqara 2:165
وَمِنَ ٱلنَّاسِ مَن يَتَّخِذُ مِن دُونِ ٱللَّهِ أَندَادًۭا يُحِبُّونَهُمْ كَحُبِّ ٱللَّهِ ۖ وَٱلَّذِينَ ءَامَنُوٓا۟ أَشَدُّ حُبًّۭا لِّلَّهِ ۗ وَلَوْ يَرَى ٱلَّذِينَ ظَلَمُوٓا۟ إِذْ يَرَوْنَ ٱلْعَذَابَ أَنَّ ٱلْقُوَّةَ لِلَّهِ جَمِيعًۭا وَأَنَّ ٱللَّهَ شَدِيدُ ٱلْعَذَابِ ﴿١٦٥﴾
And [yet], among the people are those who take other than Allah as equals [to Him]. They love them as they [should] love Allah. But those who believe are stronger in love for Allah. And if only they who have wronged would consider [that] when they see the punishment, [they will be certain] that all power belongs to Allah and that Allah is severe in punishment.
Love of Allah is the mark of the believers.
Quran, Surah Aal-i-Imraan 3:31
قُلْ إِن كُنتُمْ تُحِبُّونَ ٱللَّهَ فَٱتَّبِعُونِى يُحْبِبْكُمُ ٱللَّهُ وَيَغْفِرْ لَكُمْ ذُنُوبَكُمْ ۗ وَٱللَّهُ غَفُورٌۭ رَّحِيمٌۭ ﴿٣١﴾
Say, [O Muhammad], "If you should love Allah, then follow me, [so] Allah will love you and forgive you your sins. And Allah is Forgiving and Merciful."
Love of Allah is shown by following the Prophet ﷺ.
Sunan Ibn Majah 4261
Grading to be checked... لا يجتمعان في قلب عبد في مثل هذا الموطن إلا أعطاه الله ما يرجو ...
"These two do not meet in a servant's heart at such a time except that Allah gives him what he hopes for."
Shows the believer should combine hope and fear.
Sahih al-Bukhari 6469
Sahih... لو يعلم الكافر بكل الذي عند الله من الرحمة لم ييأس من الجنة ...
"If the disbeliever knew all the mercy that is with Allah, he would not despair of Paradise."
Balances the vastness of mercy against the reality of punishment.
Where the ruling is recorded
- al-Aqida al-Tahawiyya, Section on safety and despair. Says both lead away from Islam and the path of truth lies between them.
- Ihya Ulum al-Din (al-Ghazali), Kitab al-Khawf wa al-Raja. Explains how to balance fear and hope in different states.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.