The simplest window function is the rectangular window which corresponds to truncating the sequence after a certain number of terms.
To create a Finite Impulse Response (FIR) filter, the time domain filter coefficients must be restricted in number by multiplying by a window function of a finite width. Unfortunately, the filter response would be infinitely long since it has to reproduce the infinitely steep discontinuities at the band edges in the ideal frequency response. The filter impulse response is obtained by taking the Discrete Fourier Transform (DFT) of the ideal frequency response.
The basic idea behind the Window method of filter design is that the ideal frequency response of the filter is equal to 1 for all the pass band frequencies, and equal to 0 for all the stop band frequencies.