For fruit flies and gnats, I put out a bowl of Apple Cider Vinegar with some liquid dish soap. The soap breaks the surface tension so once they land, they are stuck and soon drown.
For flying insects I spray the windows with bug spray. The ones with Pyrethrin seem to be the fastest acting. By...