To power the A4988 and your stepper motor, you should connect VBB1 and VBB2 pins to your 12V supply. You don't need to connect both pins to the 12V rail. You only need to connect one of them to your 12V supply.
Connect A+ and A- of your stepper motor to the OUT1A and OUT1B pins on the A4988 driver and B+ and B- of your stepper motor to the OUT2A and OUT2B pins on the A4988 driver.
Connect one of the VBB pins on the A4988 driver to your 12V power supply's positive terminal.
Connect the GND (ground) from your 12V power supply to the ground (GND) of the A4988 driver.
For further reference, you can check the pinout here.
https://www.theengineeringprojects.com/2019/05/introduction-to-a4988.html