Luke 17:3 Take heed to yourselves: If thy brother trespass against thee, rebuke him; and if he repent, forgive him.
This is the only verse that I know of where Jesus puts a condition on forgiving another. Our response is to rebuke the brother. A brother is another of faith, not a stranger of the world. He should know better. If we are offended by a brother or sister of Christ, rebuke them. If he repent, forgive him. It is between you and him. We do not gossip to others about it. We go directly to the offender, tell him how he has offended and then seek reconciliation.
The word rebuke in the Greek is epitimao. Primarily, "to put honor upon," then, "to adjudge." This is something done in love. We honor the person, not put him down as the world does. Honor, says something nice and then points out the error so as to convict the person of sin.
Gal 6:1 Brethren, if a man be overtaken in a fault, ye which are spiritual, restore such an one in the spirit of meekness; considering thyself, lest thou also be tempted.
Gal 6:2 Bear ye one another's burdens, and so fulfil the law of Christ.
Gal 6:3 For if a man think himself to be something, when he is nothing, he deceiveth himself.
The brother's response is to repent. Repenting is first saying he repents, then actually turning from sin, not just words. We are to forgive him.
Luke 17:4 And if he trespass against thee seven times in a day, and seven times in a day turn again to thee, saying, I repent; thou shalt forgive him.
Seven times in a day a brother trespasses against you, and he repents seven times; we shall forgive him. If he says I repent, we forgive. Seven times in a day may try your patience, but the Lord says we are to forgive.
I want to add that Jesus expects us to forgive others, yes those who are not of faith who have really hurt you. They may not repent, but we forgive them to be free of the thoughts and emotions. Then God is responsible to convictthem or to judge them if they never repent. Give the hard ones to forgive to God. Your brother or sister has the same spirit, expect them to change. All others we give to God.