He is afraid of the dark because he is terrified of the jinn. How can he rid himself of this fear?
Question

I am afraid of the rebellious jinn and the devils, and I am afraid of the dark. Every time there is any talk about the jinn, my heart almost leaves my chest and I go into a severe panic, especially
at night. This fear is so severe that it prevents me from praying qiyam al-layl and praying Fajr in congregation. How can I rid myself of this fear?
Praise be to Allah.What you must do is gain courage by remembering Allah and always obeying Him. Allah, may He be exalted, says (interpretation of the meaning): {Those who have believed and whose hearts are assured by the remembrance of Allah. Unquestionably, by the remembrance of Allah hearts are assured} [ar-Ra‘d 13:28].
So fortify yourself with remembrance of Allah, especially the adhkar that are to be recited morning and evening, and the adhkar that are to be recited when going to sleep and when entering the bathroom. And recite Surat al-Baqarah often in your house, for the Shaytan flees from the house in which Surat al-Baqarah is recited.
You should understand that the scheme of the Shaytan is weak, and he is much more insignificant than you think. In fact, Allah has limited his scheming to whispers (waswasah), so when you are afraid of something, seek help against it by remembering Allah and turning to Him, for He is the best protector.
It was narrated that ‘Uthman ibn ‘Affan (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said:
“There is no one who says every morning and every evening ‘Bismillah illadhi la yadurru ma‘a ismihi shay’un fi’l-ardi wa la fi’s-sama’ wa huwa as-sami‘ al-‘alim (In the Name of Allah, with whose name nothing on earth or in heaven can cause harm, and He is the All-Hearing, All-Knowing)’ three times, but nothing will harm him.”
It is a sahih hadith which was narrated by at-Tirmidhi (3388), who said: A sahih hasah hadith; it was also classed as sahih by al-Albani.
It was narrated from Khawlah bint Hakeem as-Sulamiyyah that the Prophet (blessings and peace of Allah be upon him) said: “Whoever makes a stop on a journey and says, ‘A‘udhu bi kalimat Allah il-tammati min sharri ma khalaqa (I seek refuge in the perfect words of Allah from the evil of that which He has created),’ nothing will harm him until he moves on from that place.” Narrated by Muslim, 2708 and others.
A man asked ‘Abd ar-Rahman ibn Khanbash: What did the Messenger of Allah (blessings and peace of Allah be upon him) do when the devils schemed against him?
Jibril (peace be upon him) taught the Messenger of Allah (blessings and peace of Allah be upon him) to seek refuge with Allah from the evil of the devils and the rebellious jinn by saying:
A‘udhu bi kalimat illah it-tammat illatī la yujawizuhunna barrun wa la fajirun min sharri ma khalaq, wa dhara'a wa bara'a, wa min sharri ma yanzilu min as-sama', wa min sharri ma ya‘ruju fīha, wa min sharri ma dhara'a fi’l-arḍ, wa min sharri ma yakhruju minha, wa min sharri fitan il-layli wa’n-nahar, wa min sharri kulli tariqin illa tariqan yatruqu bikhayrin ya Rahman (I seek refuge in the Perfect Words of Allah, which neither the righteous nor the evil may overcome, from the evil of what He created, of what He scattered and what He made, from the evil of what descends from the heavens, and of what ascends to them, from the evil of what He scattered in the earth, and of what emerges from it, from the evil trials of night and day, and from the evil of every night visitor, except the night visitor who comes with good, O Merciful Gracious).
A sahih hadith, narrated by Ahmad (15035) and others; classed as sahih by al-Albani.
It was narrated by ‘Abdullah ibn Khubayb that his father said: I was with the Messenger of Allah (blessings and peace of Allah be upon him) on the road to Makkah, and I had the opportunity to be alone with the Messenger of Allah (blessings and peace of Allah be upon him). I draw close to him and he said: “Speak.”
I said: What should I say?
He said: “Speak.”
I said: What should I say?
He said: “Say: {Qul a‘udhu bi rabbi l falaq (Say, "I seek refuge in the Lord of daybreak)} until you complete the surah, then say {Qul a‘udhu bi Rabb in-nas (Say, "I seek refuge in the Lord of mankind)} until you complete the surah.” Then he said: “The people will not seek refuge with Allah with anything better than these two.”
A sahih hadith, narrated by an-Nasa’i (5429) and others; classed as sahih by al-Albani.
You should be careful lest the Shaytan prevent you from doing acts of worship or praying in congregation by scaring you and making you afraid. For all that he wants is to prevent you from praying in congregation, then Allah knows best what else he could lead you to of evil or prevent you from doing of good after that.
May Allah make you steadfast, give you courage, reassure you and avert from you the schemes, temptations and whispers of the Shaytan.
And Allah knows best.