Let’s get a few things straight: Putting foam on the walls does NOT soundproof a room.
Soundproofing is difficult and rather expensive. Either you are building a heavily insulated booth in your room or you are tearing your house down to the studs and adding insulation and special windows if you want something that’s soundproofed.
What is more practical and accessible is acoustic treatments to deaden your room. If you can clap your hands and hear an echo, that’s a “live” room. The less echo, the more you have deadened the sound. Sound bounces off of hard surfaces and is absorbed by soft ones. Fabric is your friend!
tip: if you need to record something and you’re away from home, ask to borrow a walk-in closet. Close the door, and record. All that clothing will help you make an amazing recording.
Acoustic foam is usually cut either with triangular ridges or an eggcrate design. When the sound waves hit the foam, what isn’t absorbed will bounce, but since it’s angled, it’s going to either bounce into another part of the foam or at least bounce away from you. Either way it helps you get echo-free audio.
If you can, put foam panels on all sides of you, including above.
If that’s not practical, at least put foam on the wall ahead of where you are speaking. Every room is different, so try different combinations of placements before making any permanent installation.
You don’t need to cover the entire room in foam, although many people do. A few rows of foam on the walls ahead, to the side, behind, and above you is usually enough to knock echoes down.
In my room, since the space available to me is a corner, I arranged my workspace so I’m talking into the corner (which is usually not a good idea) but the foam contains my voice in the area and keeps it from bouncing back so it works. Again, every room has its own peculiarities, so experiment until you find the sound that you like.