Shaykh Ibn Baz (may Allah have mercy on him) said: What is required of the Muslims in such matters is to be patient and seek reward with Allah, and not to wail, rend their garments or slap their cheeks.
Similar to that is the words of the Messenger (blessings and peace of Allah be upon him): “He is not one of us who slaps his cheeks, rends his garment and cries with the cry of Jahiliyyah” and his words in the sahih hadith: “There are four matters of the Jahiliyyah among my ummah that they will not abandon: pride in the good qualities of oneself and one’s ancestors, slandering people’s lineage, seeking rain by the stars, and wailing.” And he said: “If the woman who wails does not repent before she dies, she will be raised on the Day of Resurrection wearing a garment of pitch and a chemise of scabs.” Narrated by Muslim in as-Sahih. Wailing refers to raising the voice in lamenting the deceased.
Complete Answer: https://islamqa.info/en/answers/154215/permissibility-of-weeping-for-the-deceased-and-the-prohibition-on-wailing
Wailing, lamenting and weeping for dead person: Permissible or Not Permissible