Those that have said these things to you may be quoting John 9:31,“Now we know that God heareth not sinners: but if any man be a worshipper of God, and doeth his will, him he heareth.”
Please realize that these are not the words of Jesus but the words of the Pharisees.
Let’s turn to the teachings of Jesus regarding “sinners”… and see what He said.
Matthew 9:10-13, “While Jesus was having dinner at Matthew’s house, many tax collectors and sinners came and ate with him and his disciples. When the Pharisees saw this, they asked his disciples, ‘Why does your teacher eat with tax collectors and sinners?’ On hearing this, Jesus said, ‘It is not the healthy who need a doctor, but the sick. But go and learn what this means: ‘I desire mercy, not sacrifice.’ For I have not come to call the righteous, but sinners.’”
Jesus knew all along there were none “whole”… all are afflicted with sin. (Romans 3:10) Jesus was teaching that there are those who recognize they are sick, and there are those who have not come to realize their condition. The lack of recognizing a disease does not mean the person is disease-free. In fact anyone can have an illness and not know they are sick until symptoms appear. This is why we appeal to Jesus as the “great physician”. He can expose our disease, diagnose the areas of infection, and treat the condition – if we are willing patients. Jesus has always been looking at those who had not only a repentant heart, but a merciful heart toward others as well.
Please take time to read all of Luke the 15th chapter. Jesus gave three lessons. Who are the lessons directed to? To the “sinners that drew near.”
His first lesson was about one lost sheep out of an hundred. That ends with Luke 15:7, “I say unto you, that likewise joy shall be in heaven over one sinner that repenteth, more than over ninety and nine just persons, which need no repentance.”
Then there is a woman who had lost one piece of silver out of ten. That ends with Luke 15:9-10, “And when she hath found it, she calleth her friends and her neighbors together, saying, Rejoice with me; for I have found the piece which I had lost. Likewise, I say unto you, there is joy in the presence of the angels of God over one sinner that repenteth.”
These parables demonstrate God’s acceptance of a truly repentant heart, one who had been lost, or who had strayed away for a time.
The third is the parable of the merciful father, also known as the parable of the prodigal son. A critical verse is Luke 15:21,“And the son said unto him, Father, I have sinned against heaven, and in thy sight, and am no more worthy to be called thy son.”
It was the son’s humility and recognition of his mistake and pleading to belong to his father’s house again which was the key to his being restored. Possibly you are at that place?
One more text from Jesus in Luke 18:9-14, “And he spake this parable unto certain which trusted in themselves that they were righteous, and despised others: Two men went up into the temple to pray; the one a Pharisee, and the other a publican. The Pharisee stood and prayed thus with himself, God, I thank thee, that I am not as other men are, extortioners, unjust, adulterers, or even as this publican. I fast twice in the week, I give tithes of all that I possess. And the publican, standing afar off, would not lift up so much as his eyes unto heaven, but smote upon his breast, saying, God be merciful to me a sinner. I tell you, this man went down to his house justified rather than the other: for every one that exalteth himself shall be abased; and he that humbleth himself shall be exalted.”
You stated in your question that you “lost faith for years.” But now you have returned to seeking the Lord. Jesus words above are directed to those that have a repentant heart, and he gives his assurance of merciful treatment. If you are repentant and desiring to draw near to him, go to the Lord in prayer. But it must be remembered that Jesus on many occasions told the forgiven or healed ones to, “go and sin no more.” Honor him to the extent that you are able.
Matthew 11:28-29, “Come unto me, all ye that labour and are heavy laden, and I will give you rest. Take my yoke upon you, and learn of me; for I am meek and lowly in heart: and ye shall find rest unto your souls.”