Does spending money help the economy?

I know if you buy American, if helps support American jobs. But I think I learned that with everything you buy, tax is created for the federal government and makes the GDP raise a slight bit. Is that true? So like apple selling millions of iPhones, they are somewhat boosting the US GDP I learned.

How else does spending help? When tourists come and spend money in the US, are they boosting the GDP slightly?

Well, yes. It does.
Pretend you have a real basic economy…
You have 100 people in your country… They each spend $10 each year… So your country GDP is $1000.
Now lets say, the next year they each spend $20… You country GDP is now $2000… It doubled… That's good.
Lets say that visitors come to your country… They spend $500 there in 1 year… So your GDP is… $1500… Up 50%… That's good.
Of course in a real economy there are other variables… (money spent in your country might not stay there but be sent to other countries in the 'global economy', if spending and GDP increases it may not be equal maybe only 10% of the people in your country are getting the extra money, maybe the extra spending isn't 'real' spending but just inflation (takes a much higher price to buy the same thing so nothing really changed).
In this area though 'tax policy' has 'zero' to do with it… (that's just about the funding of government and how that's split between rich and poor (who pays what share. In fact since almost all government spending is done within your country (governments rarely buy stuff from other countries instead of their own) all that spent government money goes to your GDP and into your peoples/ business hands.
But the main point is.spending… Is what GDP 'is'… The 'TOTAL' amount of all money spent to people, wages, businesses, corporations, rich and poor, for services, goods, corporations, food each year by 'everyone' in your country (visiting/ government or no). The bigger that number, the more wealth your country has, the richer it is and the higher it's lifestyles overall.
After all… Money never 'spent' is just worthless paper. If you hide it in a shoebox under your bed and never 'use' it… It's just a nice home for mice.
P.S. 'Savings' are of course good… But when you 'save' money in banks, stocks, bonds it gets spent as 'investments' and 'interest', which is good and adds to GDP. There's no such thing as money that does nothing unless you hide it in a box or hole and never touch it again, then it's just paper.