ספר המדות Trust in God / Part I · טו
Sefer HaMiddot 445
טו. עַל־יְדֵי זְהִירָה מִלִּתֵּן תְּקִיעַת־כַּף יִזְכֶּה לְמִדַּת הַבִּטָּחוֹן. גַּם עַל־יְדֵי שֶׁלּא יִתְחַבֵּר עִם רְשָׁעִים.
15. Through being careful not to shake hands (to seal an agreement -- the probable meaning here -- as found in a parallel source cited -- is that one should be careful not to make agreements with bad people or for bad purposes. t.n.), one merits to the attribute of trust (in G-d). Also through not associating with the wicked.