The Keynesian viewpoint is that the government should have used stimulus, printed money to spur moderate inflation, and so on. Essentially very aggressive action by the government to encourage economic growth.
The US government didn't cause the great depression, but they didn't prevent it either. Ultimately, as the US government started preparing for war spending increased massively and the economy recovered as a result, as Keynesian economics would predict. But even in the late 30s there were periods where the US government tried to balance the budget (and cut spending) and unemployment rose and and the economy got worse as a result.
Govt spending isn't the only factor. Starting with Hoover and continuing with Roosevelt (until the run-up to WWII), the US govt introduced significant production restrictions in an attempt to boost prices.
The US government didn't cause the great depression, but they didn't prevent it either. Ultimately, as the US government started preparing for war spending increased massively and the economy recovered as a result, as Keynesian economics would predict. But even in the late 30s there were periods where the US government tried to balance the budget (and cut spending) and unemployment rose and and the economy got worse as a result.