If you only want to hide the content of text messages, open your Messaging app, and go to its Settings > Notifications > In-app Notification Settings. Look for the option Preview New Messages and toggle it off.