The meaning behind selamat
The word selamat appears in many Indonesian greetings and good wishes. Its meaning is associated with safety or well-being, while the word that follows identifies the occasion. Tidur means sleep and malam means night, so the two expressions do not necessarily have identical conversational roles. Once you understand this pattern, it is easier to distinguish a greeting based on the time of day from a wish related to the next activity.
Sound sleep rather than a literal translation
Tidur yang nyenyak expresses the idea of sleeping soundly. The word nyenyak describes the quality of sleep and contains the combination ny, which sounds approximately like the middle consonant in canyon. Mimpi indah refers to beautiful or pleasant dreams. These are useful phrases for a familiar exchange but need not be added to every night-time goodbye. In a brief conversation, the ordinary bedtime farewell can stand alone.
Choosing a farewell after a late meal
Imagine leaving a warung, a small eating place, after dinner. The staff may still have hours of work ahead, so a wish that specifically refers to sleep is not the obvious choice. An evening farewell or a simple thank you is more suitable in that situation. If you are staying with a host family and everyone is getting ready for bed, a sleep wish makes much more sense. The setting matters more than a fixed hour on the clock, particularly when travelling with people on different schedules.