If the Do Not Disturb mode is activated on the Samsung device, no new messages, i.e. SMS and MMS, will be displayed by default. In the exceptions, we can specify that incoming messages are allowed. Here we have the choice of All, Contacts only or Preferred contacts only (Favourites).

Android 10 (One UI 2.0)
Step 1:  Open the  Settings
Step 2:  Tap on  Notifications
Step 3:  Tap on  Do not disturb
Step 4:  Tap on  Allow exceptions
Step 5:  Tap on  Messages from
Step 6:  Choose between  All,   Contacts only ,  Favourite contacts only  and  None
  1. Open the Settings
  2. Tap on Notifications
  3. Tap on Do not disturb
  4. Tap on Allow exceptions
  5. Tap on Messages from
  6. Choose between All, Contacts only, Favourite contacts only and None

Samsung Instructions