Do things right, or do right things?

Are you more worried about doing things right, or doing the right things? Is it more important for you to follow the principles, or to act according to the specific situation? What is more priority: so that everything is according to the rules or everyone is happy or both possible?