BBC micro:bit has a few IO pins that can be used to interact with external devices. The problem with the board is that it's not easy to connect the classic jumper wires (those that we normally connect to a breadboard) to the micro:bit, unless using a crocodile clip and being limited to just 3 pins.
I've built a very simple circuit following an example you can find on this manual https://www.kitronik.co.uk/pdf/5603_inventors_kit_for_the_bbc_microbit_tutorial_book.pdf
To build the circuit you also need 4 male/female jumper wires and two buttons. All this circuit does is to connect the buttons to the micro:bit pins that relate to those buttons. Basically pressing those buttons is the same as pressing button A or button B on the micro:bit board. Here you can see the schema in detail:
"Image Copyright © Kitronik"
I've also made a short video so that you can see it in action:
And of course the source code is available too: