Companionship affects a man’s life by either making him a good human being or a bad one. That’s why many hadiths have hardly worn out from choosing bad companions and encouraged having good friends.
How does the Holy Quran represent a man of bad or good friends? The Quran considers a man who commits sins as an evil friend because this companionship led him to abstain from obeying God. God almighty says:” And whoever turns a blind eye to the Reminder of the Most Compassionate, We place at the disposal of each a devilish one as their close associate, who will certainly hinder them from the ?Right? Way while they think they are ?rightly? guided”.  A man who deviates from God’s path will move towards the devil's path. At that time, the devil will be his companion. The worst impact of this companionship is that the devil will let him think that they are rightly guided.
Regret will be the result of the companionship of the devil. God almighty says:” But when such a person comes to Us, one will say ?to their associate?, “I wish you were as distant from me as the east is from the west! What an evil associate ?you were?!”
The opposite story that the Quran tells is about those who escaped from the devil’s companionship:” But not the chosen servants of Allah, They will have a known provision, fruits ?of every type?, they will be honored, in the Gardens of Bliss, facing each other on thrones, A drink ?of pure wine? will be passed around to them from a flowing stream, crystal-white, delicious to drink, It will neither harm ?them?, nor will they be intoxicated by it, And with them will be maidens of modest gaze and gorgeous eyes, as if they were pristine pearls, then they will turn to one another inquisitively, One of them will say, “I once had a companion ?in the world?, who used to ask ?me?, ‘Do you actually believe ?in resurrection??, When we are dead and reduced to dust and bones, will we really be brought to judgment?, He will ?then? ask, “Would you care to see ?his fate??”, Then he ?and the others? will look and spot him in the midst of the Hellfire, He will ?then? say, “By Allah! You nearly ruined me”.
It is the climax of happiness that a man could reach. But this person should deeply think, at the time of living this happiness, about the reason of being in this blessing and what he faced in this life. He will remember that a bad friend was about to ruin him and that without divine guidance he would be in the hellfire.
The obedience of God does not only need a pure instinct, but a complete and perfect hard work too, to be aware of all the traps of deviation that a devil may prepare for this man.
The Path of the Rightly Guided, Al Maaref Islamic and Cultural Institution
 Surah Al Zukhruf verses 36-37
 Surah Al Zukhruf verse 38
 Surah As Saffat verses 40 to 56