The short answer is through a Congressional Appropriation.
This is a spending or appropriation bill that originates in the House of Representative. Per the US Constitution, all spending bills must originate in the House of Representatives.
Where do they get the money?
Contrary to common belief, they do NOT get the money through taxation.
The US Federal government does not have a checking account per se.
They simply legislate the money into existence.
When the US Federal Government spend a dollar, it literally comes into existence from nothing and increases the money supply by one dollar.
When they take in a dollar in taxes, that dollar ceases to exist and the money supply is decreased by one dollar.
This makes sense only when you consider that the US Federal Government is the ISSUER of US Dollars. As the issuer, they don’t have to get them from anyone.
In fact, everyone who has money got it, either directly or indirectly, from the US Federal Government.
If you think of money like a river, the US Treasury, following the laws passed by Congress, feeds money into this river and takes it out at the other end. Whatever is in the river at any given time is the money in circulation. The money we all make use of.
Does this mean the US Federal Government can buy ANYTHING whose price is denominated in US Dollars? Yes, literally.
Does this mean the US Federal Government can buy EVERYTHING whose price is denominated in US Dollars? No.
The US Federal Government does have constraints on how much they can “spend” by which I mean inject into the economy.
The constrain is the productive output of the US Economy.
In order for the Federal Government to buy something. someone in the economy has to grow it, dig it up, make it, or provide it as a service.
When we run out of ability to provide stuff, we’ve hit the limit of what the Federal Government can spend.
How do we know we’re approaching this limit? Inflation.
When the demand for something exceeds the supply of it, the price of it goes up.
When there is a general price increase in the economy, it’s because we’re in aggregate not producing enough stuff or providing enough services,
The way we bring the price back down is to produce more of whatever it is. To spur this increase in production, Congress can authorize the creation of more money with which to buy it.
If we’re at full employment and simply can’t produce more of whatever, we’ve hit our limit.
Below is a video of Stephanie Kelton doing a great job of explaining this idea.