You need a code reader to get the code, most auto parts stores will read the code for you for free. You most likely have a p0463 which is a failure of the fuel level sensor. The fuel level sensor is located in the fuel tank and sends a signal to the engine computer, the engine computer sends the information to the fuel gauge. The fuel level sensor has a arm that touches the sensor and as the level changes the arm moves along the sensor and changes the signal. The sensor can get a bad spot in it and when the arm gets to the bad spot it will send a bad signal to the engine computer. The computer will set a code and the check engine light will come on and send a incorrect signal to the fuel gauge as if the tank is empty.
To repair this issue, you must replace the fuel level sensor inside the tank. The sensor is mounted to the side of the fuel pump, remove the pump and the sensor comes off and can be replaced. To remove the fuel pump you have to lower the fuel tank. Its best to do this with a empty tank to make the job easier.
Let me know if you have any more questions on this issue.