why do supply of money effect the inflation or deflation
Money supply is simply money in circulation. Monetary policy attempts to control this, thus, attempting to keep a little bit of inflation and keep it in check.
To answer your question:
Picture a helicopter full of unlimited supply of money, just flooding the streets, from city to city, coast to coast, as it drops money into circulation literally. So, given the extra money in circulation, this "waters down" the value of that money. So the $20 dollar bill you pick up will have less purchasing power, because there is soooo much more money in circulation.
Inflation (a little bit, not helicopters), is good -- The simplest way to think about this: We don't want consumers waiting to make a purchase. We want you to walk into a store, see a TV you like, and purchase it. We don't want you to think "hmm... my dollar may be worth more tomorrow, so I will wait". We want you to inherently know that your dollar LOSES value over time due to inflation. So you think "hmm.. my dollar is at peak value today, I will purchase the TV now".
The Fed has target inflation of 2% which has historically kept the economy from going into recession. Deflation has been top of mind for central bankers. They have literally had to throw full weight of their power to try and get inflation to pick up.
Hope this helps!!!!