expression
it's best to; you can't go wrong with; it doesn't hurt to
Used in the pattern 〜に越したことはない to mean that doing something is the best or safest course of action, or that having a certain quality is always beneficial. Often used with verbs in dictionary form or nouns.
See also: 用心に越したことはない
用心するに越したことはない。
You can't be too careful.
お金はあるに越したことはない。
It doesn't hurt to have money.
健康であるに越したことはない。
It's best to be healthy.
〜方がいい is a more direct suggestion ('should do'), while 〜に越したことはない is a softer, more general statement that something is always preferable or never a bad idea.
From 越す (to exceed, to go beyond) in the negative past form 越したことはない, literally 'there is nothing that exceeds (doing something)', i.e., nothing is better than doing it.