Each of these literary concepts are very applicable to Shakespeare’s Sonnet 18. Let’s take them one by one.
Denotation refers to the strict or “dictionary” meaning of a word, while connotation refers to all of the meanings and feelings that might be associated with a word without being part of its basic definition. For example, “heart” refers to the organ in our chest that pumps blood, but it is often mentioned to connote feelings of love and affection. For that reason, we know that to say “you broke my heart” doesn’t literally mean you stopped blood from pumping through my body!
Thus, when Sonnet 18 says the beloved is “more temperate” than a summer’s day, the word “temperate” does not literally denote that the beloved’s temperature is more moderate than a summer day's. Instead, the connotation is that the beloved is even more pleasant, broadly speaking, than a perfectly warm and sunny summer day. Likewise, the beloved does not literally have an “eternal summer." Instead, the speaker references this to express feelings of passion, that the beloved’s beauty and youth seem unending. This is because one of summer's connotations is youth, since it is a time of growth.
Because of their connotations, key words that Sonnet 18 mentions, including “summer,” “darling buds,” and “eternal summer” help build a mood of warmth, youth, and pleasantness throughout the poem. This suits a poem that is so obviously a love lyric, of course.
On a deeper level, however, they point to the poem's specific and unique theme. The genius of Shakespeare’s sonnet is that it doesn’t just say that the beloved is as pleasant (or even more pleasant) than a summer’s day. Instead, it points to a theme of love’s transcendence of nature and time. “Sometime too hot the eye of heaven shines,” the poem declares, “And often is his gold complexion dimm’d.” Meaning: actually summer days can be uncomfortably hot, and everyone knows that summer days will come to an end. Yet “thy eternal summer shall not fade,” the speaker tells the beloved, “Nor shall death brag thou wander’st in his shade.” Meaning: your beauty will never end, which makes you basically immortal. This turn in the sonnet’s declarations define it thematically as a celebration of the endurance of beauty in the face of the progression of time.