The best way to stop sound escaping through your windows is to install high-quality, airtight double-glazed glass in well-fitted frames. If, however, this option is prohibitively expensive or you are renting, there is a cheaper way of soundproofing your windows you can do yourself. If you have a home studio that is irritating your neighbours or are partial to spending nights partying, much to their annoyance, making a simple window plug to soften the noise might even allow you to party even louder in the future.
Measure the window you want to soundproof and note its dimensions. You will need to record the height and length of the opening, the dimension of the frame itself and the area of any recess.
Cut soundproofing foam to cover the surface of the window and the window recess area, allowing an inch or two overlay to protrude from the opening. Secure the foam into place with the double-sided draft excluder and parcel tape, leaving the overlay exposed outside the window opening.
Draw the outline of the window opening on a board, adding a couple inches all the way around. Next, saw out the outline.
Cut insulation foam to completely cover one side of the board you have cut out and secure into place with a double-sided draft excluder.
Push the side of the board that has the foam stuck to it onto the foam overlay around the window opening and secure into place with parcel tape. If you are not too worried about damaging your walls, you can drill holes through the board and into the wall and secure with plugs and screws for a more secure fit.
Do not permanently mount a window plug board to a window you may have to use as an emergency escape route.