Man cannot so far know the connection of causes and events as that he may venture to do wrong in order to do right.
 Samuel Johnson, The History of Rasselas, Prince of Abissinia (1759). copy citation

Context

“When we act according to our duty, we commit the events to Him by whose laws our actions are governed, and who will suffer none to be finally punished for obedience. When, in prospect of some good, whether natural or moral, we break the rules prescribed us, we withdraw from the direction of superior wisdom, and take all consequences upon ourselves. Man cannot so far know the connection of causes and events as that he may venture to do wrong in order to do right. When we pursue our end by lawful means, we may always console our miscarriage by the hope of future recompense. When we consult only our own policy, and attempt to find a nearer way to good by over-leaping the settled boundaries of right and wrong, we cannot be happy even by success, because we cannot escape the consciousness of our fault;” source