My Arduino Uno buzzer isn't working
First, take a look at the two links provided in the comments to your question and explain why your question is different from them.  Start by describing your "buzzer."  If your question is not significantly different then it will attract downvotes instead of answers, or it may be marked as duplicate or just simply closed.

Here is one solution, making the assumption you are writing about a piezo beeper:

void setup() {
  pinMode(4,OUTPUT);
}
void loop() {
  digitalWrite(4,HIGH);
  delay(1000);
  digitalWrite(4,LOW);
  delay(1000);
}


Alternatively, take the first example program from your IDE, called blink, and hook your beeper to pin 13 (positive) and GND (negative) while that runs.  It does basically the same thing.