If you are stuck for time, Haarlem might be the most convenient day trip you can make from Amsterdam, because it’s a mere 15 minutes away on the train. In fact, it’s so close you can cycle to it, enjoy a nice lunch and a wander around, and then cycle back to Amsterdam in time for dinner.
Which is exactly what my friend and I did. (Those are our bikes locked to the railing in the photo below.)
But if you only have a few hours, take the train and go for coffee. Haarlem is that close.