Which device and message app? Do you have badges on for notifications ? Are you using 3rd party launcher?
I'll leave a link to register so you can communicate here, as a guest account u cant . https://forums.androidcentral.com/showthread.php?t=409154
Welcome to Android Central! Also, if you have a third party messaging app like Textra installed, make sure you enable it as your default messaging app so your phone doesn't get confused. That could be the case.
If you're talking about getting a text notification when you're in the texting app, you don't. If you stop looking at it, close it (Back button). Then you'll get notifications when you get texts. If you're looking at a text, you don't get a notification because as soon as you finish looking at that text, you'll see that you got a new one.