Correct

前事不忘,后事之师

/ qián shì bù wàng hòu shì zhī shī / 
Strokes
https://i.cchatty2.com/filters:format(webp)/fit-in/684x0/img/202102/前事不忘后事之师-Chinese-idioms-Cchatty-b731f389-d31e-4d21-9404-e10a2fc49903-1612776525.jpg

Collocation

1
难道不知道什么叫前事不忘,后事之师吗
2
记住前事不忘,后事之师的古训
3
古人说,前事不忘,后事之师

Definition

前事不忘,后事之师

Literally means:

past experience, if not forgotten, may serve as a guide for the future

Actually means:

It means one should draw lessons from the past experiences and take them as a guide in future. It is a written or literary expression.

牢记过去的经验教训,把它作为今后做事的借鉴。书面语。

Example

Used as a minor sentence, or as attributive or object. (作小句、定语、宾语)
1
Qiánshìbùwàng
前事不忘
  
,
hòushìzhīshī
后事之师
  
。
Nǐ
你
wèishénme
为什么
hái
还
zhème
这么
mǎhu
马虎
ne
呢
  
?
Nándào
难道
nǐ
你
wàng
忘
le
了
shàngcì
上次
shìgù
事故
shì
是
zěnme
怎么
fāshēng
发生
de
的
ma
吗
  
?

Don't forget the past, the teacher of the past. Why are you so sloppy? Have you forgotten how the last accident happened?

2
Zhè
这
shì
是
xuè
血
de
的
jiàoxun
教训
  
,
wǒmen
我们
yīdìng
一定
yào
要
jìzhu
记住
qiánshìbùwàng
前事不忘
  
,
hòushìzhīshī
后事之师
zhè
这
yī
一
gǔxùn
古训
  
,
bù
不
ràng
让
bēijù
悲剧
chóngyǎn
重演
  
。

This is the lesson of blood, we must remember the past do not forget, the teacher of the past this ancient teaching, do not let the tragedy repeat.

3
Tā
他
zhī
只
zhīdào
知道
mángàn
蛮干
  
,
nǎ
哪
zhīdào
知道
shénme
什么
jiào
叫
qiánshìbùwàng
前事不忘
  
,
hòushìzhīshī
后事之师
  
?

He only knows how to do, how do you know what is called the past do not forget, the teacher of the after-things?