Don't put the lid on your bento until it's cooled off, so it won't go bad.
You should wait until your bento has cooled off before you put the lid on, otherwise it could spoil.
この場合、次のような言い方ができますよ。
ーDon't put the lid on your bento until it's cooled off, so it won't go bad.
「傷まないよう、冷えるまで弁当に蓋をしないで」
to go bad で「(食べ物が)傷む」
ーYou should wait until your bento has cooled off before you put the lid on, otherwise it could spoil.
「弁当の蓋をする前に弁当が冷えるまで待って。でないと傷んでしまうよ」
to spoil「腐らせる・ダメになる」
ご参考まで!