That's basically the idea of Central banking.
When they raise rates people loose their job and their house and they can't buy stuff so demand for stuff goes down, so inflation goes down. When demand for stuff goes down and people lose jobs the economy goes down so they lower rates so companies and people get cheap loans to buy more things or hire more people. When money is cheap people buy more stuff so inflation goes up.
Rinse and repeat. But you lose in both cases taking part in the system.