If one guards his words and only uses them for good things, his prayers will be accepted by Hashem. Sefer Reishis Chochmah (Shaar Hakedushah, Perek 10) writes in the name of Sefer Yetzirah: “With this, we can understand the greatness of the early people and how they had their prayers heard immediately because they were careful not to cause harm to the 22 letters that were created by Hashem through pointless speech and other words that damage the language. Therefore, their prayers broke through the Heavens and ascended to great heights to arouse Divine mercy.”
Similarly, the Zohar Hakadosh (Parshas Shemos) writes that when Rav Shimon bar Yochai learned Torah, tens of thousands of holy angels listened to him because the words that came out of his mouth were pure and deserving of being connected to the Higher spheres.