Two verses in the New Testament show this fact. It’s easy to see one of them and then to think the other is just a parallel account or a slight variation, but the two verses make two distinct statements:
“And when you stand praying, if you hold anything against anyone, forgive them, so that your Father in heaven may forgive you your sins” (Mark 11:25).
“… if you are offering your gift at the altar and there remember that your brother or sister has something against you, leave your gift there in front of the altar. First go and be reconciled to them; then come and offer your gift” (Matthew 5:23-24).
Notice that these situations are not the same at all. Mark 11 speaks of occasions when we are asking something from God – specifically forgiveness in this case – and shows us that we cannot receive this from God (and perhaps anything) if we ourselves are not willing to give forgiveness. In Matthew 5, the occasion is one in which we wish to give something to God, but he makes it clear that he will not accept the gift (perhaps any gift) if we know others have something against us and we are not willing to accomplish reconciliation.
Taken together, these verses show how important right relationships with our neighbors are for a right relationship with God. In both these cases, God does not want to accept something - a request or a gift - from someone who is estranged from another, who is holding back something from another, whether we are holding back forgiveness or reconciliation.
In the case of our forgiving others, nothing must stop us doing this, though God understands that in situations where others have something against us we can only do our best to reconcile with them. Sometimes, others are not going to accept our attempts at reconciliation and there is nothing we can do about that, other than to pray for them.
Normally, however, in our relationship with God, whether we are asking or giving, if we hold back from our neighbor, God holds back from us. On the other hand, if we are giving forgiveness and attempting reconciliation where it is possible, God does not hold back from us in accepting that which we are asking or giving.