Inflation can have multiple causes. One is injecting too much money into an economy that is already operating at full capacity. The other is if for some reason a particular product is no longer available in the same quantities as before, and hence this scarcity results in a higher price. A bad harvest leads to a higher price of wheat etc, and a shortage of fuel leads to higher fuel prices.
Deflation is something economists want to avoid because it encourages people to postpone spending, and that leads to a downward spiral in economic activity. There is some consensus that about 2% inflation is the optimum. So if inflation drops below that, and if the economy is not operating under full capacity/full employment, it makes sense to inject money into the economy. This is what was done after the 2008 financial crisis, and to great effect (the FED and others had learned the lessons from the Great Depression).
Right now, the post Covid economy in many countries is operating at full blast, with very low unemployment etc. So it makes sense to slowly raise interest rates, and stop injecting money into the economy, and this is indeed what monetary authorities have been doing. With high inflation in many countries there is an argument in favour of doing this more agressively, but here the problem is that much of the inflation is not the product of an overheated economy but of supply bottlenecks that will not go away with higher interest rates. Raising them a lot more may push the economy into recession while inflation remains high because its cause is not the overheated economy but supply chain issues. So it is an unpleasant dilemma where stagflation looms. The best option is, where possible, to adress the supply chain problems, however hard that may be.