Generating two 1MHz, 33% duty cycle PWM signals
#include &lt;PWM.h&gt;


This is a library meant to abstract the details of the timers, so you
don't have to directly access the hardware registers. If you do access
the hardware directly, you have no use of this library: just remove this
line.


  pinMode(3, OUTPUT);


This is a program instruction (technically called a “statement”). You
cannot have instructions at the top level of the program: they must all
be within a function. Since you want all that follows to be executed
only once when the program starts (as this is just a one-time
configuration), you have to put it in setup(), as:

void setup() {
    pinMode(3, OUTPUT);
    pinMode(11, OUTPUT);
    TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
    TCCR2B = _BV(CS22);
    OCR2A = 76;
    OCR2B = 76;
}


Note that a valid Arduino program also needs a loop() function, with
all the stuff that has to be executed repeatedly. In your case, there is
nothing to be executed repeatedly, but you still have to define an empty
loop() function:

void loop() {
}