To build a window plug, first measure the dimensions of you window, including the depth of the sill, and write them down.
Find a piece of foam, or other soundproofing material with flexibility, with a depth that will fit into your window sill. The denser the soundproofing material, the better it will be at stopping sound. If possible, find a piece that is an inch or two smaller than the depth of the window sill. Allowing for a bit of dead air between the window and the foam will be more effective at soundproofing.
Take the piece of foam, or other soundproofing material, and cut it to the height and width of the window sill. Try cutting the foam slightly larger than the dimensions so that it fits tightly.
Push the foam, or other soundproofing material, into the window sill, making certain not press the foam completely against the glass. The slightly over-sized foam or soundproofing material will press against the window sill and hold it in place.
Hang heavy curtains in front of the window to help absorb sound leakage that comes through the window plug.