Check if you are in coverage service area.
Check if your device is set on Airplane mode. If so, deactivate Airplane mode.
Check if the SIM card is inserted correctly.
Check that you have not blocked certain messages such as Advertisement or Messages from Anonymous Sender in Messaging Settings.
If device memory is full, it cannot send and/or receive text messages. If device memory is full, delete any messages currently in your inbox and outbox to enable messaging.