Why if the economy will produces too much there will be an increase of prices in nearly all goods and services? I am taking an online Economics course and not understanding why if the economy will produces too much there will be an increase of prices in nearly all goods and services?
If for example there will be produced twice as much hats then needed, the price per hat will fall?

An economy that produces too little will suffer from high
unemployment, since the low rate of employment opportunities will be
inversely proportional to the high number of able-bodied workers. An
economy that produces too much will see widespread increases in the
prices of nearly all goods and services as the demand for them
outpaces production capabilities. This general increase in prices is
known as inflation.

From Teaches Economics &amp; Society (MASTERCLASS) by PAUL KRUGMAN
The passage from Krugman is quite confusingly written. What Krugman has in mind is not increase in production per se but increase in aggregate demand which is associated with more production.
The short run relationship between real output and price level (change in which gives you inflation) can be visualized on aggregate supply-aggregate demand (AS-AD) diagram (see Blanchard et al Macroeconomics or Mankiw Macroeconomics for more detail).
If production (Y) expands because economy is able to produce more and firms expand their production that will lead to decrease in prices (P) - and hence deflation.  As the picture I below drew shows, when economy produces more because firms on the whole supply more to the market (AS shifts to the right), the price level would be expected to fall ceteris paribus:

However, what Krugman has in mind is change in aggregate consumer preferences that shift demand more (i.e. AD shifts to the right), this will lead to higher prices and more production (in the short run) because this higher demand and prices motivate firms to supply more. However, Krugman makes it sound in the passage above as if there was increase in supply by firms (where the chains of events starts with more production rather than with more demand as in this second case).
In this case aggregate prices increase because people demand too many goods and services and firms can only satisfy that extra demand at higher cost (since production capability of economy given by AS did not change). Consequently, firms will only be willing to supply extra goods and services if they are motivated by higher prices.