How can I advise someone who is addicted to pornography?
Question

I have a friend who uses the internet and goes to pornographic websites. What is the shar’i ruling on that, and how can I help him to keep away from such things?.
Praise be to Allah.It is not permissible to look at pornographic pictures that show the charms of women, either on internet web sites or in newspapers or magazines etc. That is because looking at them is a means of enjoying them and knowing the beauty of the woman in the picture. 
This may also be a means that leads to something haram, so it is also regarded as haram, because the means come under the same rulings as the ends. 
Fataawa al-Lajnah al-Daa’imah, 2424. 
Many people take the matter of looking at pictures of non-mahram women lightly, on the grounds that these are just pictures and are not real. But this is a very serious matter, because it inevitably tempts a man to try to look at the woman directly. Allah says (interpretation of the meaning): 
“Tell the believing men to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts). That is purer for them”
[al-Noor 24:30]
Majmoo’ Fataawa wa Rasaa’il Ibn ‘Uthaymeen, 1/268
You can help your friend to keep away from these things by always advising him and making him fear Allah, and reminding him that Allah is always watching him and that nothing is hidden from Him. And remind him of the blessings that Allah has bestowed upon him, such as giving him eyes with which to see things that will benefit him, and He has forbidden him to use them to look at things that He has forbidden. Remind him that Allah will question him about that, hence Allah concludes the verse referred to above with the words (interpretation of the meaning): 
“Verily, Allah is All-Aware of what they do”
[al-Noor 24:30]
And Allah says (interpretation of the meaning): 
“Verily, the hearing, and the sight, and the heart of each of those ones will be questioned (by Allah)”
[al-Isra’ 17:36]
If a wise man thinks about it, when he is looking at these haram pictures, he will realize that there is nothing behind these glances but loss, pain and sorrow, because he cannot really get what he sees in these pictures. 
The poet spoke the truth when he said: 
“When you give free rein to your eyes, this will cause great pain to your heart.
You will see what you cannot have, and you will feel frustration because you do not have some of what you see.” 
So it is clear that there is nothing to be gained from these pictures except the wrath of Allah, and wasting time and money on things that are not pleasing to Him, and tormenting yourself. 
The Muslim has to seek chastity by means of marriage, and try his best to achieve that. 
He should also give up bad company who may have a bad effect on him and encourage him to go to these bad web sites. 
He should also keep himself busy with things that will benefit him in both religious and worldly terms, such as memorizing the Book of Allah, attending gatherings of dhikr, and going to useful websites that contain sound knowledge.