Yunus was the son of Matta; the Prophet ﷺ called him "Yunus ibn Matta" in an authentic hadith in Sahih al-Bukhari. The Quran names him among the messengers who received revelation (4:163) and calls him Dhun-Nun, "the man of the fish" (21:87), and "the companion of the fish" (68:48). The commentators explain that he was sent to the people of Nineveh, near Mosul in today's northern Iraq.
Yunus called his people to believe in Allah and obey Him, but they did not respond. He left them in anger (21:87). The Quran says he ran away, like a servant fleeing his master, to a fully laden ship (37:140); the commentators explain that he left before Allah had given him permission to go.
At sea the ship was in danger, and the people on board drew lots. The lot fell on Yunus and he was thrown into the sea (37:141). A great fish swallowed him, and he was blameworthy (37:142).
In the layers of darkness — the commentators say the darkness of the night, of the sea and of the fish's belly — he called out: "There is no god but You, glory be to You; indeed I was among the wrongdoers" (21:87). Allah says that had he not been one of those who glorify Him, he would have stayed in its belly until the Day of Resurrection (37:143–144). Allah answered him and saved him from his distress, "and so do We save the believers" (21:88).
The fish cast him out onto a bare shore, and he was ill, and Allah made a gourd plant grow over him (37:145–146). Had his Lord's favour not reached him, he would have been thrown onto the bare land in disgrace; but his Lord chose him and made him one of the righteous (68:49–50).
His people, meanwhile, had believed. The Quran says that no town believed and benefited from its faith except the people of Yunus: when they believed, Allah removed from them the humiliating punishment in this world and let them enjoy life for a time (10:98). Allah sent Yunus to a hundred thousand or more, and they believed (37:147–148); most commentators understand this as his return to his own people.
The Prophet ﷺ taught that the supplication of Yunus in the belly of the fish is one that no Muslim makes for anything without Allah answering him (a hadith reported by al-Tirmidhi and graded authentic by scholars). He also said that no one should say he is better than Yunus ibn Matta (Sahih al-Bukhari; Sahih Muslim). Allah told the Prophet ﷺ to be patient with his Lord's decision and not to be like the companion of the fish (68:48). The Quran does not tell us where or how Yunus died.