The replies to the original question were excellent and require no amplification.
The poster added a follow up question that was not adequately addressed: what is the solution to stagflation?
To answer that question definitively requires knowledge of the cause of stagflation; or the causes, if there are different kinds of stagflation requiring different kinds of solutions.
Since there are three main components of stagflation (high inflation, low GDP growth, and high unemployment), it might help to consider them both individually and in terms of any interrelated dynamic.
Presumably one could have a condition of high inflation and low economic growth without high unemployment, provided low economic growth represented sn equilibrium condition. After all, what constitutes low or high growth depends on the country, the age and developmental stage of its economy, and other factors. So generally we must assume a fairly sudden change in the economy, such as a recession which causes mass layoffs and raises the unemployment rate.
Low economic growth in the presence of high unemployment can reasonably be assumed to be the result of low sales (or growth in sales) resulting from low consumer demand for goods and services, at least in part because total consumer demand has been shrunk by unemployment (which reduces total wages and salaries paid).
Inflation can be caused by loose monetary policy; but if easy credit or simple money printing is responsible, it begs the question of how demand for goods and services can be low enough so that no incentive for hiring or other business expansion exists.
On the other hand, wage and salary rises written into labor contracts or accepted as a business obligation on the basis of prevailing social mores could lead businesses to pass these increased labor costs on to consumers in the form of higher prices.
One way that might work is if something acted to increase producer prices, such as an OPEC initiated oil shock, as occurred twice in the 1970s. This would increase wholesale prices since manufacturing inputs must be transported to factories and goods must be distributed to retailers. Retailers in turn may pass on these cost increases to consumers; and consume-workers may in turn agitate for cost of living increases to compensate.
In fact, during the period known for stagflation, in the 1970s and early 1980s, all of these were present: energy shocks, resulting recessions and layoffs, a vicious cycle of price and wage increases, and loose monetary policy which facilitated the inflation resulting from the vicious cycle.
Two things ended stagflation in the early 1980s.
Federal Reserve policy under Chairman Paul Volcker tightened the money supply (at its peak the prime lending rate reached 21 percent) and though this caused a deep recession and greatly exacerbated unemployment, the economic shutdown broke the inflationary cycle caused by price and wage increases; that is, business activity declined to such a drastic existent that retailers were compelled to freeze or even lower prices just to move unsold merchandise, since unemployment rose so high that consumer demand for goods and services shrank greatly rather than growing slowly as had previously been the case.
This still left the recession and high unemployment.
The government under the Reagan administration responded with classic Keynesian stimulus: huge increases in federal deficit spending as a percentage of GDP transferred wealth from the coffers of the financial sector (where it sat idle with no productive investment outlet in a recession) and into the hands of the federal government, which spent it in the economy on goods and services or transferred it to households who would, via tax credits and social spending.
The resulting increase in total economic demand (private plus public sector) -stimulated business hiring and expansion, ending the recession and ushering in growth.