WOW!! Galatians 2:11-21 is a passage I can truly appreciate.
Although this never feels good and could cause confrontation, this was a sincere act by Paul. He was NOT telling others Peter can't be trusted or followed anymore, but CORRECTING his conduct. All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: (2 Timothy 3:16 KJV). Peter was a Christian leader but his actions represented the people and not Christ. As we read Barnabas, a fellow Christian leader also followed his hypocrisy, which could have damaged the new church so correction was done in accordance to the Word.
If you make a public or private mistake don't beat yourself up. Comdemnation and guilt will try to attach itself to us when we compromise our walk. It will try to make us feel like we can never get back up from our fall, but we CAN overcome this by confessing our sins to God and others where needed & repent (a change of mind, or a conversion from sin, followed by the relinquishment of any practice that has offended God.). God has provided a way of forgiveness, restoration, and salvation that comes only through His Son, JESUS CHRIST, and not our own efforts. He is just and faithful to forgive us so that we can get back on track.
PRAYER: Lord forgive me for my hypocrisy. Jesus you were often criticized for hanging around the disabled, demon possessed, tax collectors, sinners, non-Jews, and so forth, but you came that you would save the lost. You are no respecter of persons. You died for both Jew and non-Jew, rich and poor, popular and unknown, male and female. There is no reason for me to act different around certain people. Help me keep from being a people pleaser or clique-ish so that you are glorified. I do not want others to see my actions as ok to follow. In Jesus name--AMEN