This advice came from the book Beartown written by Frederik Backman:
If you are honest, people may deceive you. Be honest anyway.
If you are kind, people may accuse you of selfishness. Be kind anyway.
All the good you do today will be forgotten by others tomorrow.
Do good anyway.
What you create, others can destroy. Create anyway.
Because in the end, it is between you and God.
It never was between you and anyone else anyway.