Your phone has a proximity detector that turns off the screen when you hold the phone to your face, so your face doesn’t activate any “buttons”. It is located at the top of the screen, and appears to be a tiny red “point” (smaller than a “dot”) that may be visible in the dark. If the proximity detector is covered by your hand, case or screen protector the it will result in the screen turning off when on a call, just as if you were holding the phone to your face.
If you are sure it is not blocked in any way you may have a hardware problem; contact Apple Support using the “Support” link at the very top of this page to discuss repair options.