To feel blue or to have the blues means to feel depressed or sad, as in
After seeing my old house in such bad shape, I had the blues for weeks, or
Andrew tends to feel blue around the holidays.
The noun blues, meaning “low spirits,” was first recorded in 1741 and may come from blue devil, a 17th century term for a demon, or from the adjective blue meaning “sad”, usage first recorded in Chaucer’s Complaint of Mars.
The idiom may have been reinforced by the notion that anxiety produces a livid skin color.
Source: The Free Dictionary