user17362: I moved my white King to d4, taking black's bishop. This put the king in a checkmate with black's knight on c6. Is this move legal or illegal? Thank you.

user17136: Kd4 is not a legal move. You are never allowed to put yourself into a check.
Even though it's possible to argue "black's knight can't take my king as that would put his king in check", it's still not legal. You can imagine that if the game could continue, black would capture the white king before white could capture the black king, and black would therefore win. This is of course just a device for explaining the why, as capturing a king is just as much an illegal move as putting your own king in check.

17362: <p><a href="https://i.stack.imgur.com/s33Np.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s33Np.jpg" alt="enter image description here"></a>I moved my white King to d4, taking black's bishop. This put the king in a checkmate with black's knight on c6. Is this move legal or illegal? Thank you.</p>
 17136: <p>Kd4 is not a legal move. You are never allowed to put yourself into a check.</p>

<p>Even though it's possible to argue "black's knight can't take my king as that would put his king in check", it's still not legal. You can imagine that if the game could continue, black would capture the white king before white could capture the black king, and black would therefore win. This is of course just a device for explaining the why, as capturing a king is just as much an illegal move as putting your own king in check.</p>
