Evil is part of the creation of Allah and not attributing it to Allah is part of proper verbal etiquette
Question

Here is the translation of the Ayahs: 4:78 - "Wherever you may be, death will overtake you even if you are in fortified towers. If a good happens to them, they say:'This is from Allah," but if an evil befalls them, they say:'This is from you(O Muhammad).' Say:'All are from Allah,' so what (is wrong with) these people that they do not seem to understand any word? " 4:79 - "Whatever reaches to you of good, is from Allah, but whatever befalls you of evil, is from yourself. Allah has sent you (Muhammad) for mankind as a messenger, and Allah is Sufficient as a Witness." Is evil from ourselves or from Allah. Non-Muslims view this as a contradiction in the Quran but we all know that the Quran is free from contradictions. Can you please explain this?.
Praise be to Allah.Understanding this aayah is easy for the one whom Allah enables to understand it. It is one of the unambiguous aayahs in the clear Book of Allah, and there is no contradiction in it, except in the minds of some of the haters, who are aided by their ignorance of Arabic and of the meanings of the Holy Quran, so they think that the words of Allah (interpretation of the meaning): “but whatever of evil befalls you, is from yourself” [al-Nisa’ 4:79] mean that calamities, which are referred to here as “evil”, are created by man himself. This is obvious ignorance which no one falls into but someone who has no knowledge of the Arabic language, or an Arabic-speaker who is misled and overwhelmed by his whims and desires. That is because the preposition min (from) here, in the phrase min nafsika (“from yourself”), refers to the cause, i.e., it is because of you yourself, O man, because of your disobedience and your going against the command of Allah, that calamities befall you, as Allah says (interpretation of the meaning): “And whatever of misfortune befalls you, it is because of what your hands have earned. And He pardons much” [al-Shoora 42:30].  
Al-Haafiz Ibn Katheer (may Allah have mercy on him) says: The words “And if some good reaches them” [al-Nisa’ 4:78] mean: abundance and provision, of fruits, crops, children and the like. This is the meaning of the words of Ibn ‘Abbaas, Abu’l-‘Aaliyah and al-Saddi. 
“they say, ‘This is from Allah,’ but if some evil befalls them” [al-Nisa’ 4:78], i.e., drought, famine, lack of fruits and crops, or death of children, and so on – as Abu’l-‘Aaliyah and al-Saddi said. 
“they say, ‘This is from you (O Muhammad صلى الله عليه وسلم)’”, i.e., because of you, and because of our following you and following your religion, as Allah said concerning the people of Pharaoh (interpretation of the meaning):
“But whenever good came to them, they said: ‘Ours is this.’ And if evil afflicted them, they ascribed it to evil omens connected with Moosa (Moses) and those with him”
[al-A’raaf 7:131]
and as Allah says (interpretation of the meaning):
“And among mankind is he who worships Allah as it were upon the edge (i.e. in doubt): if good befalls him, he is content therewith; but if a trial befalls him he turns back on his face (i.e. reverts to disbelief after embracing Islam). He loses both this world and the Hereafter” [al-Hajj 22:11]
“Say: ‘All things are from Allah’” [al-Nisa’ 4:78], i.e., everything happens by the will and decree of Allah, which applies to the righteous and evildoer, to the believer and disbeliever, alike. ‘Ali ibn Abi Talhah said, narrating from Ibn ‘Abbaas: “Say: ‘All things are from Allah” i.e., both good and bad. Al-Hasan al-Basri said something similar. 
Then Allah said, addressing the Messenger (peace and blessings of Allah be upon him), but the message is to mankind, that the answer to this question is: “Whatever of good reaches you, is from Allah”, i.e., by the grace, bounty, kindness and mercy of Allah. 
“but whatever of evil befalls you, is from yourself” i.e., from you, and because of your own actions, as Allah says elsewhere (interpretation of the meaning): “And whatever of misfortune befalls you, it is because of what your hands have earned. And He pardons much” [al-Shoora 42:30]. Al-Saddi, al-Hasan al-Basri, Ibn Jurayj and Ibn Zayd said: “is from yourself” means, because of your sins.  
Qataadah said: “Whatever of good reaches you, is from Allah, but whatever of evil befalls you, is from yourself” [means] it is a punishment, O son of Adam, for your sins. And he said: We are told that the Prophet of Allah (peace and blessings of Allah be upon him) used to say: “No man is scratched by a thorn, or stumbles, or has a twitching in a vein, except for a sin, and what Allah forgives is greater.” 
This which was narrated by Qataadah in a mursal report was narrated in a muttasil report [i.e., with a complete isnaad] in al-Saheeh: “By the One in Whose hand is my soul, no worry or grief or hardship befalls a believer, not even a thorn that pricks him, but Allah will expiate some of his sins thereby.” End quote. Tafseer al-Quran il ‘Azeem (2/361-363). 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) says: 
Allah says (interpretation of the meaning): “Whatever of good reaches you, is from Allah,” [al-Nisa’ 4:79], i.e., what reaches you of victory, provision and well being, comes from Allah, a blessing that He has bestowed upon you; even if it is because of your good deeds, He is the One Who has guided you, helped you, made things easy for you, blessed you with faith and made it attractive to you, and has made disbelief, evil and sin hateful to you. 
At the end of the saheeh hadeeth qudsi that was narrated by Abu Dharr from the Prophet (peace and blessings of Allah be upon him), he tells us that his Lord, may He be blessed and exalted, said: “O My slaves, they are merely your actions which I am recording for you, then I will requite you for them. Whoever finds it to be good, let him praise Allah, and whoever finds it to be otherwise, let him blame no one but himself.” According to the saheeh hadeeth: “The best prayer for forgiveness is to say: ‘Allahumma anta rabbiy laa ilaaha illa anta, khalaqtani wa ana ‘abduka wa ana ‘ala ‘ahdika wa wa’dika ma astata’tu, a’oodhu bika min sharri ma sana’tu aboo’u laka bi ni’matika ‘alayya wa aboo’u laka bi dhanbi, faghfir li fa innahu laa yaghfir ul-dhunooba illa anta (O Allah, You are my Lord and I am Your slave, You have created me and I am faithful to my covenant and my promise (to You) as much as I am able. I seek refuge with You from the evil of that which I have done. I acknowledge before You all the blessings You have bestowed upon me and I confess to You my sin. Forgive me for there is no one who forgives sin except You).’ Whoever says this during the day believing in it with certainty and dies that day before evening comes, will be one of the people of Paradise, and whoever says it at night believing in it with certainty and dies before morning comes will be one of the people of Paradise.” 
Then Allah says: “but whatever of evil befalls you”, such as humiliation, fear and defeat, such as what befell you on the day of Uhud, “is from yourself”, i.e., because of your sins and errors, even though that is already decreed and ordained for you, because the divine decree is not a justification for anyone, and will not be accepted by against Allah, or by people. If it were permissible for anyone to refer to the divine decree to justify what he does of bad deeds, then no wrongdoer would be punished, no mushrik would be fought, no hadd punishment would be carried out, and no one would refrain from wronging anyone else. This would cause a great deal of mischief and corruption in both religious and worldly affairs, which is something that no one can dispute, whether on a rational basis or on a shar’i basis. End quote. 
Majmoo’ al-Fataawa (8/113-114) 
Al-‘Allaamah al-Sa’di (may Allah have mercy on him) said: 
Allah tells us of those who do not know, who turn away from that which the Messengers brought, who are opposed to them: that if something good comes to them, i.e., abundance, a lot of wealth, many children, good health, they say: “This is from Allah”, but if something bad comes to them, i.e., drought, famine, poverty, sickness, death of children and loved ones, they say: “This is from you (O Muhammad صلى الله عليه وسلم)”, i.e., because of what you have brought to us, O Muhammad; they regard the Messenger of Allah (peace and blessings of Allah be upon him) as a bad omen as others like them regarded the Messengers of Allah as bad omens, as Allah tells us that the people of Pharaoh said to Moosa:
“But whenever good came to them, they said: ‘Ours is this.’ And if evil afflicted them, they ascribed it to evil omens connected with Moosa (Moses) and those with him”
[al-A’raaf 7:131]
And the people of Saalih said:
“They said: ‘We augur ill omen from you and those with you’”
[al-Naml 27:47]
And the people mentioned in Soorat Yaa-Seen said to their Messengers:
“They (people) said: ‘For us, we see an evil omen from you; if you cease not, we will surely stone you…’”
[Yaa-Seen 36:18]. 
Just as the people of kufr think alike, so too their words and deeds are similar. This applies to everyone who attributes the occurrence of bad things or the loss of good things to what the Messengers brought or to part of it; that comes under this stern criticism.  
Allah says in response to them: “Say: ‘All things”, good and bad, “are from Allah”, i.e., by His will and decree and creation. 
Then Allah says: “Whatever of good reaches you”, i.e., in your religious and worldly affairs, “is from Allah” who is the One Who bestows them and makes it easy to attain them by facilitating their means.  
“but whatever of evil befalls you”, in your religious and worldly affairs, “is from yourself”, i.e., because of your sins and what you have earned, and what Allah forgives is greater. 
Allah has opened to His slaves the gates of His kindness and has bid them enter by His grace and bounty. He has told them that sins prevent His bounty, so if a person does them he should not blame anyone but himself, because he is the one who has prevented the grace and bounty of Allah from reaching him. 
End quote. Tafseer al-Kareem al-Rahmaan (p. 188). 
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked: 
Allah says (interpretation of the meaning): “And if some good reaches them, they say, ‘This is from Allah,’ but if some evil befalls them, they say, ‘This is from you (O Muhammad صلى الله عليه وسلم).’ Say: ‘All things are from Allah’” [al-Nisa’ 4:78], then in the next verse He says (interpretation of the meaning): “Whatever of good reaches you, is from Allah, but whatever of evil befalls you, is from yourself”. How can we reconcile between them? 
He replied: 
They may be reconciled by noting that the first verse refers to the decree of Allah, i.e., it is from Allah; He is the one who decrees it. The second verse refers to the cause i.e., whatever of evil befalls you, you are the cause, and the One Who decrees evil and decrees the punishment for it is Allah. End quote. 
Liqaa’aat al-baab il-Maftooh (no. 15, question no. 15). 
And Allah knows best.