Can the King kill the Queen in check?


don't forget boyz: not smart players make sure to keep every piece (except queen) out of the 3x3 square surrounding the king, otherwise that's a free piece!

So..following that logic, can somebody tell me why my king couldn't take the queen in this situation? - https://www.chess.com/analysis/game/live/69025241787?tab=review
In the previous example the Queen was undefended, but in yours the Queen is defended by the Bishop. The King can capture any of the opponent's pieces that are adjacent to it unless by doing so they would be in check (as in your example, check from the Bishop). .