The structure of the idiom is beautifully simple and effective. It pairs 日 (day) with 夜 (night) to signify “all the time.” It then uses two different characters for “to think”—思 (sī) and 想 (xiǎng)—to emphasize the relentless and all-encompassing nature of this longing. The combination “day think, night think” creates a powerful and poetic image of non-stop, obsessive thought.
日思夜想 is a literary term, but it is very much alive in modern conversation, especially when expressing strong, heartfelt emotions.