If you look at these two verses, they seem to directly oppose each other.
The verse in James implies that once a person has turned away from the faith, they can still go back, and have eternity with God.
The verse in Hebrews implies that a person who rejects God will not escape hell.
We started off thinking if it was possible that there was a difference between the 'wandering' described in the verses in James, and the 'refusing' described in Hebrews, with the refusing being the one that would give a person no escape. At this point one man said that he had friends who had decided that they no longer believed in Christ's death and resurrection, and wondered if that then meant that there was no point in praying for them any longer because they were going to hell.
Going with this argument of the difference between 'wandering' and outright 'refusal' one could argue, that someone who 'wanders' from the truth of Jesus Christ is not 'refusing' God outright; but I disagree:
When you 'wander' in the full sense of the word, you are still in complete command of where your feet are going; it is not as if they have a mind of their own. Wandering simply means that slowly but surely, one is taking small steps that slowly lead them further and further away from the 'right way'. What that means is that they are still refusing to go the 'right way', but are being less obvious about it.
This takes us back to square one.
It is only when we look closely at the passages that we notice that in fact there is no contradiction in them at all.
The passage in James is in the present continuous. It doesn't matter which version of the bible you are reading, all of them are written in the present tense. So when it says,
"My brothers and sisters, if one of you should wander from the truth and someone should bring that person back, remember this: Whoever turns a sinner from the error of their way will save them from death and cover over a multitude of sins"
It means if a person wanders (ongoing), but is brought back (ongoing) they will be fine (future-ongoing).
The passage in Hebrews, is also in the present continuous. So when it says,
"See to it that you do not refuse him who speaks. If they did not escape when they refused him who warned them on earth, how much less will we, if we turn away from him who warns us from heaven?"
It means that if someone refuses (ongoing) and doesn't turn back (ongoing) they will not escape hell (future-ongoing).
What this means when you bring the two verses together, is that provided our refusal of Jesus Christ is not a permanent one, we can still have eternity with Him. It is only if we refuse God and His sacrifice forever, that we cannot.
So for that gentleman who was worried about his friends and whether or not he should continue praying for them, he should. It isn't over, until it's over.
The bible always talks about God's mercy, I find it hard to believe that the same merciful God who sent His only son to die for all of sinful mankind; would turn away a prodigal who was truly repentant and had come home.
Hope this helps!