Xinhua cites 《南齐书·公冶度》: 季文子三思而后行 — 'Ji Wenzi would think three times before acting.' The Analects 论语 records Confucius's dry response: 再,斯可矣 — 'Twice is enough', implying Ji was overthinking. The phrase survives as straightforward advice.
grammar
Literally 'three-think and-then act'. 三 here is idiomatic 'many times', not literally three. 而 is the classical conjunction linking thought to action.