The big danger with foam on a hard surface is that it could create a triple leaf system.
Besides, getting foam that is actually useful is next to impossible. You would need high density open cell foam and that's not common in the marketplace. I tried to get some, but the manufacturer told me it would need to be made, or I could wait for leftovers from another order. Even those leftovers were expensive.
That's why I use mineral fiber board. Thickness 4 to 6". Less than 4" is useless. Easy to handle and cut and not as nasty as glass fiber. Frame and cover with textile to your liking. I've used prints for that, opens up possibilities for visual integration.
I tend to treat large, even surfaces first.
But most important for me are measurements. I can't hear everything, like people with golden ears can. But I can see what's wrong in a graph and, more importantly, I can see where it's coming from.
And sometimes, it comes from the desk, not the walls. If it's the desk and the speakers are also on the desk, sliding them a few inches to the left or to the right could be enough to solve reflections. If it's bad, replace the desk surface with a perforated one.