Consider three situations...
1) I'm walking down the street and someone punches me.
2) I'm walking down the street with a friend and someone punches my friend.
3) I'm walking down the street and someone uses Gods name in a bad way.
Now I think that I can forgive the other person for a sin that is commited against me.
Can I forgive someone for a sin if that sin is commited against another person?
Can I forgive someone for a sin if that sin is commited against God?
All sin is against God whether you are involved or not. And, when you don't forgive onto other peoples sins, in effect you are saying that the sin has to be remembered to hold the person accountable.
Mathew 18:21-35
Then Peter came to Jesus and asked, "Lord, how many times shall I forgive someone who sins against me? Up to seven times?"
Jesus answered, "I tell you, not seven times, but seventy-seven times.
"Therefore, the kingdom of heaven is like a king who wanted to settle accounts with his servants.
As he began the settlement, a man who owed him ten thousand bags of goldwas brought to him. Since he was not able to pay, the master ordered that he and his wife and his children and all that he had be sold to repay the debt.
"The servant fell on his knees before him. Be patient with me, he begged, and I will pay back everything. The servants master took pity on him, canceled the debt and let him go.
"But when that servant went out, he found one of his fellow servants who owed him a hundred silver coins. e He grabbed him and began to choke him. Pay back what you owe me! he demanded.
"His fellow servant fell to his knees and begged him, Be patient with me, and I will pay you back.
"But he refused. Instead, he went off and had the man thrown into prison until he could pay the debt. When the other servants saw what had happened, they were greatly distressed and went and told their master everything that had happened.
"Then the master called the servant in. You wicked servant, he said, I canceled all that debt of yours because you begged me to. Shouldnt you have had mercy on your fellow servant just as I had on you? In anger his master handed him over to the jailers to be tortured, until he should pay back all he owed."
"This is how my heavenly Father will treat each of you unless you forgive a brother or sister from your heart."
Romans 2:1-4
You, therefore, have no excuse, you who pass judgment on someone else, for at whatever point you judge another, you are condemning yourself, because you who pass judgment do the same things. 2Now we know that Gods judgment against those who do such things is based on truth. 3So when you, a mere human, pass judgment on them and yet do the same things, do you think you will escape Gods judgment? 4Or do you show contempt for the riches of his kindness, forbearance and patience, not realizing that Gods kindness is intended to lead you to repentance?
Romans 3:22-26
...There is no difference between Jew and Gentile,
for all have sinned and fall short of the glory of God, and all are justified freely by his grace through the redemption that came by Christ Jesus. God presented Christ as a sacrificeof atonement, through the shedding of his bloodto be received by faith. He did this to demonstrate his justice, because in his forbearance he had left the sins committed beforehand unpunished he did it to demonstrate his justice at the present time, so as to be just and the one who justifies those who have faith in Jesus.