As the name implies, window fans are located in window openings. Depending on how they are set, they either pull warm inside air out of the home or blow outside air in. Most people do not like the blast of outside air window fans create when they pull air into the home. So more often, they are used to ventilate the home by moving inside air out so it can be replaced with cooler "outside" air.
To be most effective, window fans should be located in a window on the hottest or the downwind side of the house so natural air currents will assist rather than fight them. Also, because hot air naturally rises, it's a good idea to put them in windows toward the top of the home, (i.e. an upstairs window of a two-story home). Then, open one or more downstairs windows on the coolest or upwind side of the house. Interior doors between the two windows must remain open to allow air flow.
Window fans work well in houses that are fairly "open" inside, but do not do well in homes with long, narrow hallways or many interior partitions that may interfere with air "flow."