The first step is easy: neutralize them with any base, such as baking soda. You don't need precision, just add a lot of it, and make sure the pH is close to 7 (or beyond, baking soda is not corrosive) at the end. After this step, the solution is no longer acidic or corrosive and much safer to handle.
Unfortunately, the next step is tricky. The solution is safe, but it still contains a lot of Cu+ ions, which is a heavy metal pollutant and poisonous.
On the other hand, if your sulfuric or hydrochloric acid is unused for etching anything (clean without those nasty ions), you are good to go, just dump them in the sink after you've neutralized them (test with pH paper) it's perfectly safe.