Try to Restart your iPhone, iPad, or iPod touch: https://support.apple.com/en-ca/guide/iphone/iph8903c3ee6/ios
If issue persists I would take the phone in for diagnosis, as it still has warranty.
You can get your device serviced by contacting Apple Support, or by visiting an Apple Store or Apple Authorized Service Provider near you:
Start a service request: http://getsupport.apple.com/
Find an Apple Authorized Service Provider: https://locate.apple.com/
Make an Apple Store appointment: http://www.apple.com/retail/geniusbar/
Contact via phone: https://support.apple.com/HT201232
Contact your carrier: https://support.apple.com/HT204039