If you overdosed on the algaecide, the foam will dissipate in a few days. To speed up the process, clean the water surface with the skimmer. You may shock the pool to break algaecide down quicker, however, it is an unnecessary step.