The letter that Apostle John wrote was to believers in general.....
1John 1:1-4 - That WHICH was from the beginning, Which we have heard, Which we have seen with our eyes, Which we have looked upon, and our hands have handled, of the Word of life. (For the life was manifested, and we have seen it, and bear witness, and show unto you that eternal life, Which was with the Father, and was manifested unto us:) That Which we have seen and heard declare we unto you, that ye also may have fellowship with us and truly our fellowship is with the Father, and with his Son Jesus Christ . And these things write we unto you, that your joy may be full.
It seems that John within his letter to the saints was concerned over certain opinions or philosophy that had been mixing in with the Christian faith. One of them was the opinion that Jesus had only appeared to have a body but he really didn't have one (speaking of the body of Jesus after his resurrection). The second opinion that seemed to be of concern to John that was going around was that the things (deeds) we do while living in our bodies (which are inherently evil as we were born in sin) couldn't make us unclean or pollute our souls (which are inherently good). Of course this is gnostic philosphy or teaching. And apostle John is making it clear to the believers at the start of his letter that the gospel was based on the actual evidence of the physical senses in that he had heard, seen, and even touched Jesus himself after the resurrection when Jesus had appeared to ten of the apostles in......Luke 24:36-43 - And as they thus spake, Jesus himself stood in the midst of them, and saith unto them, Peace be unto you. But they were terrified and affrightened, and supposed that they had seen a spirit. And he said unto them, Why are ye troubled? Behold my hands and my feet, that it is I myself: handle me, and see; for a spirit hath not flesh and bones, as ye see me have. And when he had thus spoken, he showed them his hands and feet. And while they yet believed not for joy, and wondered, he said unto them, Have ye here any meat? And they gave him a piece of broiled fish, and of an honeycomb. And he took it, and did eat before them. So the apostle John is giving witness to the believers that Jesus did have a literal resurrected body that he himself saw and touched with his own hands as Jesus even ate broiled fish and honeycomb in his resurrected glorified body.
Apostle John further into his letter says in......1 John 3:9-10 - Whosoever is born of God doth not commit sin; for his seed remaineth in him: and he cannot sin, because he is born of God (1 Peter 1:23). In this the children of God are manifest, and the children of the devil: whosoever doeth not righteousness is not of God, neither he that loveth his brother. John is pointing out and insisting that no one who is a true Christian can go on living a sinful physical life in his body after salvation because there is eternal consequences (Galatians 6). John states this in.......1 John 4:2 - Hereby know ye the Spirit of God: Every spirit that confesseth that Jesus Christ is come in the flesh (body) is of God. Every Christian must acknowledge that Jesus has come in the flesh. Apostle John has built his whole letter around this knowledge or wisdom of God and on the live we have in Christ. If there are brothers and sister among us that deny these truths. Then even if they are among us Apostle John says they are not of God they do not have the Spirit of God abiding with in them. We as believers must turn away from such people and not listen to them because they are really not for Christ they do not believe him and they are anti- Christ and have not been regenerated or born again and made a new creature in Christ Jesus. Our salvation rests upon the death, burial and resurrection of Jesus and the confession of these truths.
Getting to the question in the OP. It is our guilty conscious that condemns us before God when we sin or mess up and do wrong in life. Our conscious if not seared convicts us of our wrong doing before God and if we have unconfessed sin in our lives then our fellowship with God is broken during those times. Our guilty conscious they will not let us approach God and ask or make our petitions known to him. Unconfessed sins will take our confidence towards God away from us as John says this to the believers in...1 John 5:13-21.
Now let's look at 1John 5:16-17 - If any man see his brother sin a sin which is not unto death, he shall ask, and he shall give him life for them that sin not unto death: (1 John 3:20-24; Job 42:8; James 5:14) There is a sin unto death: (Matthew 12:31; Mark 3:29; Hebrews 6:4, 6) I do not say that he shall pray for it (Jeremiah 7:16; John 17:9). All unrighteousness (wrongdoing) is sin: and there is a sin not unto death (1 John 3:4).
If we see a fellow believer in Christ doing wrong we should offer to pray with them and give them godly counsel so they can confess their faults (sins or wrongdoings) and be restored in their relationship (fellowship & confidence) with God. Both Apostle Paul and James the apostle wrote in their letters in......Galatians 6:1-2 - BRETHREN, IF a man be overtaken in a fault, ye which are spiritual, restore such a one in the spirit of meekness; considering thyself, lest thou also be tempted. Bear ye one another's burdens, and so fulfil the law of Christ.........James 5:13-20 - vs. 16) Confess your faults one to another, and pray one for another, and pray one for another, that ye may be healed (spiritually). The effectual fervent prayer of a righteouss man availeth much......vs. 19-20) Brethren, if any of you do err (stray) from the truth, and one convert him; Let him know, that he which converteth the sinner from the error of his ways shall save a soul from death, and shall hide a multitude of sins. It is the same way if someone is sick they are to call on the elders of the church to pray for them and they can be healed of physical sicknesses by the prayers of the righteous.
Jesus told us that any kind of sin can be forgiven if we just confess and forsake it. But if a person blasphemes the Holy Ghost of God then this sin will never be forgiven a person they can pray and repent all they want too but God will stop up his ears and not hear their prayers of forgiveness and pardon them. They will have no hope ever of reconciliation with God the Father.
Bottom line is that as a Christian all of our faults and failures can be forgiven us if we confess them to God and he will forgive us and will hear our prayers and have fellowship with us and our confidence will be restored to us toward God. It is good to know as a Christian if I mess up and sin that no matter what it is or how bad it is in my conscious that I can pray and ask for forgiveness and it will be granted as he will give more grace to help us in times of need. But if I blaspheme the Holy Ghost my prayer of confession will not be heard it will be unto death (eternal seperation from God).
But we are to turn away from the false teachers who do not believe Jesus came in the flesh. Because we are saved through faith by the grace of God who sent his only begotten Son into this world that we could be saved. Jesus was the sacrifice for our sins. 2 John vs. 7-12