Anonymous is right; picking up guns and ammo off of the dead is a good solution.
However, your enemies are often carrying different weapons than the ones you start out with. So if you want to keep your default weapons, the best thing to do is to conserve your ammo (i.e. don't spray your bullets everywhere; try to take down the enemy with as few shots as possible). Sometimes there are ammo crates where you can refill all the ammo for whatever weapons you are carrying.
Another thing is that often the enemies will all be carrying the same kind of weapon, so if you pick up a gun from them, you shouldn't have any trouble getting more ammo; just walk over the guns that others have dropped, and if you are carrying the same gun, you will automatically pick up the ammo from it.
One more thing: sometimes your secondary weapon is a pistol. Pistols are good because you can switch to them faster than you can switch to a rifle, but if you want to keep your original primary weapon AND you want to pick up an enemy's weapon, you can switch to your pistol and then pick up the enemy's weapon. This will replace your pistol with their weapon so you won't lose your primary.
For more info, check out this strategy for the Call of Duty: Modern Warfare 3 campaign.