|Try a couple of things. First take your headphones and plug them in then unplug them about 15-20 times. Sometimes the jack can get dirt or lint buildup on the contacts and plugging and unplugging will clean them up.|
If that doesn't work, try a reset. Hold the power off and the home button down at the same time until the device reboots and you see the Apple logo. If you see a screen that says swipe to power off, just ignore it.