Chances are, it’s the case you have on it that’s causing the issue. At the top of the iPhone, there is a proximity sensor that is used during a call to determine whether or not you are holding the phone up to your ear. If this sensor becomes blocked, the iPhone can’t correctly determine where it is being held during a call which in turn causes issues using the on screen buttons during said call.
I have a Lifeproof case; if you’re not familiar with the case, it essentially waterproofs the iPhone up to 5 meters deep. Since it renders the iPhone waterproof, the entire phone must be enclosed in the case. The company has built in little windows for all of the sensors on the iPhone, however as with all windows they get dirty over time. Cleaning off the proximity sensor window in your case should solve the problem. To clean the case, use warm soapy water and microfiber cloth or equivalent; lightly wipe the windows on the inside and outside of the case.
This problem may not be limited only to Lifeproof cases, if you have a case that covers the proximity sensor, you could have this issue as well. If you had this issue and this little blurb about it helped you, please let us know in the comments!