Hello Khatami_navid,
The fact that the screen does not turn back on after removing it from your ear is an issue, that is not normal.
I would recommend a force reset for starters:
- iPhone 8: On an iPhone X, iPhone 8, or iPhone 8 Plus: Press and quickly release the Volume Up button. Press and quickly release the Volume Down button. Then, press and hold the Side button until you see the Apple logo.
If this still happens, and you don't have a case that could possibly be blocking that sensor out, I strongly would recommend taking it to Apple or an Authorized Dealer to take a look.
You can start that repair here if need be: https://getsupport.apple.com/?caller=home&PRKEYS=
Cheers!