Godly Sorrow Brings Repentance
Nobody likes to be rebuked, but if we do not realise how offensive our sin is, we need it (Proverbs 3:11-12). Paul deeply loved the believers in Corinth and yet their tolerance of immorality not only offended God but gave licence to other believers to think it did not matter (Revelation 2:20). So, Paul wrote strongly, urging them to take radical action in 1 Corinthians 5:1-13, and probably also in a subsequent letter that has been lost.
It is painful to rebuke those you love, but it is a normal part of parenting, and God rebukes His dearly loved children, so that they may repent and be restored to relationship with Him (Hebrews 12:5-11). However as sensitive human beings we dislike having to rebuke, especially if we see it brings grief to those we love. Paul felt that way about his previous letter and now describes his personal revulsion at causing the pain. On the other hand he was happy because it resulted in them seeing their sin and responding in repentance and taking the necessary action.
Some say that God always wants you to be happy; but the Bible does not say that. Paul was glad that the Corinthian believers realised that they were out of order with God and were grief-stricken because they had offended Him. It was what God intended - the route to repentance, forgiveness and restored fellowship. The church remained precious to Paul and him to them (2 Corinthians 7:6-7). No harm was done by causing such pain because it was God directed, leaving no regrets in the rebuker or the rebuked.
Humanly, we fear rebuking because we do not want to be hated. It is true that those who mock the truth will hate being rebuked, but those who love the truth will welcome the opportunity to repent (Proverbs 9:8). It is a brave thing to do, not knowing if the rebuke may shatter a friendship - but as the Lord directs, it may save wrong-doers from a hell-bent path (James 5:20). There is a difference between lashing out in anger to criticise people who hurt you (Proverbs 29:22), and allowing the Lord to give you the right words at the right time (Galatians 6:1) to speak as His ambassador to be reconciled to God (2 Corinthians 5:20-21). Pray about it so that the truth can be delivered without being clouded by your own emotions.