Most countries nowadays separate government funding from central bank policies (tight vs loose monetary policies), so it is uncommon to inflating away government debt by creating an artificial inflationary scenario. Nevertheless, we can explain the mechanism.
The artificial inflationary scenario is created by a higher issuance of money (by the central bank) with the sole purpose of decrease purchase value of money. When higher quantities of money than required are issued, inflation takes place rapidly, therefore, the current government debt becomes cheaper in real terms (easier to repay).
Your reasoning is good, but be careful with the timing. As I said above, the intention of deflating debt (make it cheaper for the gov) is to first create an artificial inflation scenario. This is created using a loose monetary policy by the central bank (note that the central bank must lack independence from gov to this be true). Central bank will never increase the rates as it should be to counter inflation because the objective is to deflate government debt. Foolish.
This is why central banks MUST and ARE independent from government policies. Also, this is why it is important to understand monetary policies vs fiscal policies because they are independent from each other in most countries and are not always coordinated, so they can cancel each other out, potentiate each other, or lead to an uncertain outcome.