Today, everything we do or say in public is seen by many people, and if it's not we post it somewhere on social media to make sure others know what we've done today. It's as if we are so accustomed to this world of social media, constant communication, and instant gratification, that we try really hard to receive validation and appreciation for our actions: we need people to see we are doing good things and to respond to us, we need a certain number of 'likes' and 'comments' for our actions to be of value. I often see - when I'm on Facebook or similar social media - videos of people giving to the homeless, or giving an extra big tip in a restaurant, or helping someone out: people record themselves doing these things and then share them online for the world to see and know "that person is doing good things". But the Bible says that when we do this, our reward is already "received in full". In other words, when we show our good deeds to the world, and receive validation from the world in this way, the only reward we will receive for that deed is of this world - it is of no eternal value. When we act in this way, our deeds are committed for other people and for our own selfishness, not for God.
The acts are still good and the Bible teaches that we should help others...but the only validation you need, and the only reward you should want or hope to receive, for doing these things should come from God! It says in Matthew 6:4 "the Father who sees what is done in secret, will reward you"!
This does not mean 'don't do good deeds when you are in public' please don't let me confuse you: if you are in public and see someone in need, someone you can help, by all means help them - God has called you to help them regardless of who is around you at the time or who might see you helping them. What it does mean however, is 'don't do good deeds because you are in public', and 'don't make your good deeds public'. Do good deeds because God has called you to and because His goodness is in your heart.
God knows your heart - this is a fact that perhaps we like to forget sometimes: because that means he knows everything: all the mean thoughts, or the cruel ideas, all the gossip, all the bad intentions - God knows. No one else in the world knows, but He does. When we act with the intention of being perceived on Earth as doing good, God knows. He knows the actions aren't genuine, and though the world will praise you for your outward appearance, He will not reward you for this. We shouldn't act to receive rewards from this world (the judgments of man are worth nothing), but in a way that God will praise when He judges us in the next.
Your actions and thoughts should be good because your heart and intentions are good. You should be doing good things, helping others and showing compassion because God lives in you and that is what he wants you to do! So when you act in secret: when you help someone and tell no one that you did: when you donate money anonymously: when you forgive others in your heart without demanding an apology or falling out with them: when you show kindness and expect nothing in return (not even worldly validation) - God sees this, He knows your heart and He will reward you! And in case there is a shadow of doubt in your mind, let me reassure you: His rewards are awesome(!), they are more wonderful than you could ever imagine and worth so much more than any worldly reward you could receive. God's plan for you is for you to be a blessing, not for you to be recognized by the world as being a blessing.
So ask God to purify your heart, and do good things to demonstrate His love, do these things in secret (without boasting or declaring them) and He will reward you.