~ことだ({忠告|ちゅうこく})
You should …; the best thing is to … (advice)
N3
V dictionary / V-nai + ことだ
~ことだ is strong advice, typically from someone older or more experienced to a junior: 「{上手|じょうず}になりたければ、{毎日|まいにち}{練習|れんしゅう}することだ」. It sounds firmer than ~ほうがいい and is not used to advise superiors or customers. A condition often comes first (~たければ, ~なら). Do not confuse it with ~ことはない ('no need') or ~ことにする ('decide'); ことだ addresses the listener, not oneself.
Examples
日本語が上手になりたければ、日本人とたくさん話すことだ。
If you want to get good at Japanese, talk with Japanese people a lot.
風邪を早く治したいなら、無理をしないで寝ることだ。
If you want to get over your cold quickly, don't push yourself and get some sleep.
失敗したくなければ、わからないことはすぐ先輩に聞くことだ。
If you don't want to fail, ask a senior right away when you don't understand.
Exercises
1.班長「仕事を早く覚えたいなら、メモを取る 。」
2.腰を痛めたくなかったら、重い物は一人で ことだ。