After marking the beadboard at the sides of the opening, mark the distance between the last board and the edge of the hole onto the face of the board. Take the board down and use a square to extend your marks to meet each other. Notch the board with a jigsaw. If the opening is big enough, install cut boards butted against the sides of the hole, then finish with another notched board.
For a circular opening, dry fit each piece individually and reach into the hole with a marker and trace the shape of the opening on the back of the board.