For example if everyone is given a government job to dig a hole and then fill it in again does that really help the economy?
?What is "the economy", and why should it need help
That job certainly helps the guy who has the job. And his family. And the businesses at which he spends his wages. And the businesses that do business with those businesses...
Whether this helps "the economy" depends both on what you mean by "the economy", and on what that guy would do if he
didn't have a government job digging holes and filling them in again.
Would he be paid instead to do nothing at all? Would he be forced into crime to make ends meet? Would he become a stockbroker and a millionaire? Would he get a job in a factory, building cars? Or Main Battle Tanks? Would he join the army, and spend his days painting rocks white, and marching up and down in straight lines?
Does his impact on the economy change if the army orders him to dig holes and fill them in again?
How about if the tanks his factory builds get parked in some huge holding area just in case the USA is invaded, and then never get used? Or if the tanks are donated to Ukraine, and blown up by the Russians? Is building tanks (or warships, or military aircraft) good for "the economy"?
If there is zero useful work for him to do, is the economy better served by him starving; Or doing pointless tasks for the government, or the army; Or being paid to stay home and persue his hobbies instead?