I know that Prophet Ya’qoob (Jacob), may Allah exalt his mention, complained/cried to Allah about his sadness, but did he wail? Is it okay to wail to Allah? There is a hadith that says that wailing at times of sorrow is cursed. May Allah reward you.
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
Linguistically speaking, wailing (Arabic: 'Aweel) refers to weeping loudly, to raising the voice with crying and screaming, to the sound coming from the chest while crying, or to screaming (at times of grief) without crying. All this is referred to as wailing. So if you mean by wailing raising the voice with crying and screaming, as is apparent in the question, then this is something unbefitting of the Prophets of Allah, who are the most patient in the face of afflictions. Among them is Prophet Ya’qoob, may Allah exalt his mention. It was not stated in the Quran that he wailed and cried in a loud voice. Rather, Allah described him in the Quran as "Katheem", which means the one suppressing and hiding his grief.
The author of At-Tahreer wa At-Tanweer said, "Katheem is the hyperbolic form of Kaathim, derived from Kathm, which means internal suppression; i.e. suppressing grief and hiding it from people and weeping in seclusion instead."
How could it be conceived that such a person would wail and cry out in grief?!
You asked, 'Is it okay to wail to Allah?' You should know that wailing in the form of crying only is permissible. The Prophet, sallallahu ‘alayhi wa sallam, cried when his son Ibraaheem passed away and said, "The eye tears up and the heart grieves, but we say only what pleases our Lord, and we are indeed grieved by your departure, O Ibraaheem." [Al-Bukhaari]
As for wailing in the sense of raising the voice with crying and screaming, this is the Niyaahah that is prohibited in Islam.
The author of Al-Mirqaat said, "The word Niyaahah means crying and lamenting the deceased with loud screams and cries..."
Abu Moosa, may Allah be pleased with him, narrated that the Prophet, sallallahu ‘alayhi wa sallam, said, "Verily, the Messenger of Allah, sallallahu ‘alayhi wa sallam, disassociated himself from the woman who wails loudly, shaves her head, and tears her garments in grief." [Al-Bukhaari and Muslim]
Ibn Daqeeq Al-ʻEed commented on the hadeeth, saying, "The Arabic word As-Saaliqah used in the hadeeth means the woman who wails loudly when a calamity befalls her. It is deduced from the hadeeth that such practices are prohibited."
Allah knows best.
You can search for fatwa through many choices