I read that Japan rapidly increased the printing of Yen and used the money to buy government bonds. How did this action reduce the yields of their government bonds and prevent them from having a debt crisis like Greece?
There are two legs to this question.
How did this action reduce the yields of their government bonds
The price of a bond and its yield are inversely related: if the price goes up, the yield goes down, by definition.
The assumption is that increased purchases by the central bank raises their price, by using supply/demand logic. However, these supply/demand arguments implicitly assume that bond traders are automatons who cannot adjust their selling prices. As such, there can be a debate about how much bond yields fall because of central bank purchases.
and prevent them from having a debt crisis like Greece?
The situations of Greece and Japan are different. The Japanese governments borrows (almost) exclusively in yen, a currency the government controls. (They might have a token amount of foreign currency borrowing, like many other developed countries. Even if they do, the size of the borrowing programme is much smaller than their foreign currency reserves.) The Bank of Japan effectively endures that the Japanese government can issue new bonds near its policy rate.
Conversely, the Greek government (mainly) borrows in euros, but the central bank for the euro is the ECB. The ECB let Greek bonds yields to decouple from other euro bond yields, which forced the Greek government to default.