It depends on whether you are having issues receiving iMessages or SMS text messages. If your iPhone is connected to the Internet and you can’t receive iMessages, try resetting iMessage as described in this article. https://www.ianswerguy.com/not-receiving-imessages
If you are having issues receiving SMS text messages, make sure your iPhone does not have Airplane Mode active. Otherwise, you will need to contact your cellular provider to have them check your account settings.
If you just switched from an iPhone to another phone and you are no longer receiving text messages from iPhone users, this article should help. https://www.ianswerguy.com/not-receiving-text-messages-from-iphone-users