Gluing wood and foam can be extremely tricky--the foam's absorbent nature makes it difficult to glue, and some glues can even cause the foam to melt. However, using Polyurethane construction adhesive will allow you to complete this task in a short amount of time.
Roughen the surface of the wood with the 80-grit sandpaper. Rub continuously in a circular motion over the surface that the foam will be glued to. This will create a more porous surface, allowing the cement to penetrate the wood.
Apply Polyurethane construction adhesive to both the sanded wood surface and the surface of the foam that will be glued to the wood. Use a 2-inch sponge brush to apply a consistent layer over both surfaces. Allow the cement to set for five minutes.
Press the glue-coated foam surface to the glue-coated wood surface. Apply even pressure throughout, and rub from the centre towards the outer edges of the foam. Allow the glue to set for six to eight hours.
Consider clamping wood and foam together during the drying time to form a more reliable bond.