The government has instruments such as treasury bills, government securities and government bonds. These are all high denomination instruments. They are exchanged with the general public at fixed prices. People tend to invest in these bonds for the purpose of getting a return, which is usually equal and/or lower than the market rate. However, the catch in this transaction is the reliability and low risk associated with these securities. As these products are directly owned and regulated by the government, there is a very low probability of these products defaulting or in other words failing to produce a profitable return.
Secondly the government calculates the money in distribution and the targeted money in circulation. This is performed by the central bank which hires expert economists for this sole purpose based on various calculations and assumptions, they decide whether to inject more money in the market or withdraw.
The government then announces these bonds through open advertisements so that all potential and willing buyers can bid for these instruments. As these products are of high denomination so they cannot be bought by everyone. Large financial institutions such as banks, investments houses, insurance companies etc are usually on hand to buy these securities through an open and fair bidding process.
For instance, if the government wants to increase the money supply, it will then buy back these instruments through the same process as mentioned in step 3, where the general public will be receiving plenty of money in return. This will result in the increase in the money supply. On the other hand, if the government decides to decrease the money supply, it will then sell these instruments, which will see money leaving the hands of the general public.