If, for example, you do the right thing or do the decent thing in a situation, you do something which is considered correct or socially acceptable in that situation.
People want to do the right thing and buy 'green'.
Carrington did the honourable thing and resigned.
I think I did the wrong thing.