Lets start with the basics, have you checked to see if any CEL codes have been generated? If so they may point you to the problem.
When's the last time you did a tune-up, like plugs, wires, cap, rotor, etc ?
I got tune up 3 months ago I have a bad knock sensor can that be a cause of bad mpg