Short answer
Islam forbids superstition, omens and fortune-telling. An omen is a sign of coming luck, good or bad. Before Islam, Arabs read their fortunes in the flight of birds. They took the owl as a sign of death and thought the month of Safar unlucky. The Prophet (ﷺ) swept all of this away. He said there is no bird omen, no hama and no Safar. Scholars explain these as the owl omen and the unlucky month of Safar. He told Muslims not to go to fortune-tellers. The Qur'an calls divining arrows the work of Satan, and says only God (﷾) knows what is hidden. In place of the bad omen, the Prophet (ﷺ) left hope: he liked a good word. When the sun went dark on the day his son died, people said the sun had darkened for his death. He told them eclipses happen for no one's death or birth.
Full explanation
Four beliefs swept away in one sentence
The Prophet (ﷺ) named four beliefs of pagan Arabia and denied them all. Tiyara is reading omens in the flight of birds. Scholars give more than one meaning for the other three words. Many explain them like this. 'Adwa is the belief that disease spreads by its own power, apart from God (﷾). Hama is the owl taken as a sign of death. Safar is the month thought to bring bad luck.
Abu Huraira reports that the Prophet (ﷺ) said there is no 'adwa, no tiyara (bad omens from birds), no hama and no Safar. Many scholars explain 'adwa as disease spreading by its own power apart from God, hama as the owl taken as a sign of death, and Safar as the month held unlucky.
Not a denial of cause and effect
Denying 'adwa does not mean denying that illness spreads. In the same saying the Prophet (ﷺ) told people to keep away from a leper. He also told them not to enter or leave a land struck by plague. What he denied is that anything acts on its own, apart from God (﷾). Care is taken, but the outcome belongs to God (﷾), not to luck.
Abu Hurayra reports that the Prophet (ﷺ) denied 'adwa, bird omens, hama and Safar (which many scholars explain as the owl omen and the unlucky month of Safar), and in the same saying told people to run from a leper as they would run from a lion.
The Prophet (ﷺ) said: if you hear of plague in a land, do not go into it; and if it breaks out in a land where you are, do not leave it.
The saying about the house, the woman and the horse
Al-Bukhari was a ninth-century collector of the Prophet's (ﷺ) sayings. He records the Prophet's (ﷺ) saying that if bad luck were in anything, it would be in a house, a wife or a horse. Some reports give it without the "if". Many Muslim scholars explain that this is not a return to omens. It speaks of the three things a person lives with most closely. They bring real hardship when they are unsuitable: a cramped house with bad neighbours, a bad-tempered wife, a horse never ridden in God's (﷾) cause. A person who is unhappy with one of them may leave it. Others, among them Malik, an eighth-century scholar of Medina, took it literally. God (﷾) may make a house a cause of harm by His decree, not by any power of its own. That is still not an omen.
Sahl ibn Sa'd reports that the Prophet (ﷺ) said: if there were bad luck in anything, it would be in a woman, a horse and a house.
Ibn Umar reports that bad omens were mentioned in front of the Prophet (ﷺ), and he said: if there were bad luck in anything, it would be in a house, a woman and a horse.
Abdullah ibn Umar reports that the Prophet (ﷺ) said there is no 'adwa and no bird omen, and in the same saying that bad luck is in three things: a woman, a house and a riding animal.
On the saying about bad luck in a house, a woman and a horse, al-Nawawi records the scholars' explanations. One is that the bad fortune of a house is its narrowness and bad neighbours, of a wife her ill temper or childlessness, and of a horse that it is not ridden in God's cause. Another is that a person who dislikes living with one of these may leave it. He also records that Malik and a group of scholars took it literally, that God may make living in a house a cause of harm by His decree.
Fortune-tellers and the unseen
The Qur'an says that no one in the heavens or on earth knows the unseen except God (﷾). It tells the Prophet (ﷺ) himself to say that he does not know the unseen. So he told a new Muslim not to go to soothsayers (fortune-tellers). He warned that whoever asks a fortune-teller about anything has his prayer refused for forty nights. People said a soothsayer's words sometimes came true. He answered that one stolen true word is mixed with more than a hundred lies. The Prophet (ﷺ) also condemned crediting the stars with what God (﷾) does. Muslim scholars hold that reading the future in the stars falls under the same rule, because no one but God (﷾) knows the unseen.
“Say: None in the heavens or on earth, except Allah, knows what is hidden: nor can they perceive when they shall be raised up (for Judgment).”
“Say: "I have no power over any good or harm to myself except as Allah willeth. If I had knowledge of the unseen, I should have multiplied all good, and no evil should have touched me: I am but a warner, and a bringer of glad tidings to those who have faith."”
Mu'awiya ibn al-Hakam, newly Muslim, told the Prophet (ﷺ) that some of his people went to soothsayers. The Prophet said not to go to them. Of those who took omens, he said it was a feeling they found in themselves, and it must not turn them from what they meant to do.
One of the Prophet's (ﷺ) wives reports that he said: whoever goes to a fortune-teller ('arraf) and asks him about anything, his prayer is not accepted for forty nights.
Aisha reports that people asked the Prophet (ﷺ) about soothsayers, and he said they are nothing. When they said the soothsayers sometimes told them things that came true, he said that a jinn snatches one true word and passes it to its friend, who mixes it with more than a hundred lies.
Zayd ibn Khalid al-Juhani reports that the Prophet (ﷺ) led the dawn prayer at al-Hudaybiyah after a night of rain, then told the people that their Lord had said: this morning some of My servants became believers in Me and some disbelievers. Whoever says we had rain by the grace and mercy of God believes in Me and disbelieves in the stars; whoever says we had rain because of such-and-such a star disbelieves in Me and believes in the stars.
Divining arrows
Pagan Arabs drew lots with arrows to decide what to do. The Qur'an names divination by arrows next to wine and gambling. It calls them all the work of Satan, to be avoided.
“O ye who believe! Intoxicants and gambling, (dedication of) stones, and (divination by) arrows, are an abomination,- of Satan's handwork: eschew such (abomination), that ye may prosper.”
The omen is in the one who takes it
The Qur'an tells of people who blamed their troubles on the prophets sent to them. Pharaoh's people called Moses a bad omen, and a town called its messengers one. The answer both times is that their ill fortune came from themselves and was in God's (﷾) hands. The Prophet (ﷺ) said an omen is only a feeling in the heart, and must not stop a person from what he meant to do. In its place he liked the good word: hope, not dread.
“But when good (times) came, they said, "This is due to us;" When gripped by calamity, they ascribed it to evil omens connected with Moses and those with him! Behold! in truth the omens of evil are theirs in Allah's sight, but most of them do not understand!”
“The (people) said: "for us, we augur an evil omen from you: if ye desist not, we will certainly stone you. And a grievous punishment indeed will be inflicted on you by us." They said: "Your evil omens are with yourselves: (deem ye this an evil omen). If ye are admonished? Nay, but ye are a people transgressing all bounds!"”
Mu'awiya ibn al-Hakam, newly Muslim, told the Prophet (ﷺ) that some of his people went to soothsayers. The Prophet said not to go to them. Of those who took omens, he said it was a feeling they found in themselves, and it must not turn them from what they meant to do.
Anas reports that the Prophet (ﷺ) said there is no 'adwa and no tiyara, but that he liked fal. Asked what fal was, he said: a good word.
The eclipse on the day his son died
The sun was eclipsed on the day the son of the Prophet (ﷺ), Ibrahim, died, and people said it was because of his death. He could have let them believe the heavens were mourning his son. Instead he told them the sun and moon are not eclipsed for anyone's death or birth, and that they should pray. A man making up a religion would have kept the sign. He gave it away.
Al-Mughira ibn Shu'ba reports that the sun eclipsed on the day the Prophet's (ﷺ) son Ibrahim died, and people said it had eclipsed because of Ibrahim's death. The Prophet said that the sun and the moon do not eclipse for the death or the birth of anyone, and told them to pray and call on Allah when they see an eclipse.
Perspectives
The Islamic perspective
Superstition, omens and fortune-telling are forbidden. The Prophet (ﷺ) replaced fear of signs with trust in God (﷾) and hope in the good word. He refused a sign even when it would have honoured him.
The Prophet (ﷺ) denied 'adwa, bird omens, hama and Safar.
Many scholars explain the three words this way. The first, 'adwa, is the belief that disease spreads apart from God (﷾). Hama is the owl omen, and Safar is the unlucky month of Safar.
Sahl ibn Sa'd and Ibn Umar were companions of the Prophet (ﷺ). In Sahl's report and in one report of Ibn Umar, the saying is worded as a condition. It says that if bad luck were in anything, it would be in a house, a woman or a horse.
He still told people to avoid contagion and not to enter or leave a land struck by plague.
He forbade going to soothsayers, and said that whoever asks a fortune-teller has his prayer refused for forty nights.
The Qur'an says only God (﷾) knows the unseen. It tells even the Prophet (ﷺ) to say he does not know it.
The Qur'an names divination by arrows as the work of Satan.
In place of the bad omen, the Prophet (ﷺ) said he liked a good word.
The sun was eclipsed on the day his son died. He told people that eclipses happen for no one's death or birth.
A man inventing a religion would have used the eclipse. The Prophet (ﷺ) refused it, which is the mark of a truthful messenger.