He thought it would be smarter to keep quiet.

Literal

Be-silent-was [way-方] [subject-が] clever is [quotative-と] he [topic-は] thought.

~た方がいい/利口 ('it's better/smarter to (have done) X') uses 方 ('way, side') as a comparative anchor. The past form 黙っていた pre-positions the action so that 'doing X' is the choice being recommended. Worth noting that 利口 ('clever, smart') is a na-adjective and so takes だ as its copula in plain form. Subject of 黙っていた is omitted; the only overt subject is 彼 (the thinker).