Both possible causes have already been mentioned. Here's how to diagnose them.
1) To diagnose a loose headset. Stand next to the bike holding the bars. Now drop your but onto the top tube and apply weight i.e. sit. Pull the front brake hard and rock the bike forwards and backwards. Look for a mechanical clack clack feel rather than noise, but try and distinguish between brake flex and a little bit of noise/feel as the brakes move forward and backward and that of a loose headset bearing. Also, if you pick the bike up by its neck (stem) and bash it down, you'll feel a loose headset via feedback. To diagnose poor headset bearings, grab the bike by the neck, pick it up and move your fist left and right to "steer". The bearings will give you smooth or rough feedback depending on their condition. If at first you don't feel anything, compare a few bikes. Soon you'll settle on a baseline and know the condition of yours.
2) To diagnose poor front wheel bearings. Put the bike on a stand or have someone hold it off the floor. Spin the front wheel and put your ear on the top tube. A rumbling bearing will talk to you and say either: rrrrreplace me or, ssshhhhhh leave me alone.
Bikes can talk. My money is on the headset.