Correct

前人栽树,后人乘凉

/ qián rén zāi shù hòu rén chéng liáng /
Strokes
https://i.cchatty2.com/filters:format(webp)/fit-in/684x0/img/202102/前人栽树后人乘凉-Chinese-idioms-Cchatty-bcad26c6-998d-42ba-93d8-5f0eeefd4f23-1612776526.jpg

Collocation

1
要前人栽树,后人乘凉,不要前人砍树,后人遭殃
2
干的是前人栽树,后人乘凉
3
这就是前人栽树,后人乘凉

Definition

前人栽树, 后人乘凉

Literally means:

one generation plants trees in whose shade another generation rests

Actually means:

profit by the labor of one's ancestors

It figuratively means profiting by the labor of one's ancestors or sweating for the benefit of future generations.

比喻前人付出劳动,让后人受益。

Example

Used as a minor sentence, or as attributive or object. It can also be used separately. (作小句、定语、宾语,也可分开使用)
1
Qiánrénzāishù
前人栽树
  
,
hòurénchéngliáng
后人乘凉
  
men
我们
de
bèi
父辈
wéi
men
我们
zào
造福
  
,
men
我们
yào
wéi
sūn
子孙
zào
造福
  

The former planted trees and the verses cooled off. Our fathers benefit us, and we benefit our children and grandchildren.

2
men
我们
zhù
筑路
gōngrén
工人
  
,
gàn
de
shì
qiánrénzāishù
前人栽树
  
,
hòurénchéngliáng
后人乘凉
de
shì
  
,
zài
xīn
辛苦
zhíde
值得
  

We road-building workers, do is the former planted trees, the longer take advantage of the cool thing, and then hard is worth it.

3
Zài
huánjìng
环境
bǎo
保护
wèn
问题
shàng
  
,
men
我们
de
zuò
做法
yīnggāi
应该
shì
qiánrénzāishù
前人栽树
  
,
hòurénchéngliáng
后人乘凉
  
,
ér
shi
qiánrén
前人
kǎn
shù
  
,
hòurén
后人
zāoyāng
遭殃
  

On the issue of environmental protection, our approach should be for the former to plant trees, for the later to cool off, rather than for the former to cut down trees, and for the after-life to suffer.