confused

What are you supposed to do when your boyfriend of almost 3 years says "I think we should take a break" out of no where? 
He told me he's just not happy right now, which I don't really understand because he seems happy when he's around me and this is the first I'm hearing of him being unhappy. 
I'm not sure what to do..