To check for Check you need to implement a function that checks if a given spot is currently being attacked by the opponent. Basically you loop through all of the opponents pieces, iterate trough all of their possible moves and see if they can attack that spot. Then you execute that function on the spot where the King is to see if the King is in Check.
Checkmate is more difficult. You need to iterate trough all of YOUR possible moves and see if after you perform the move the king is still in Check. As soon as you find one move that works, you can stop checking.
Another challenge is disallowing discovered Checks. So the player can't move into Checking themselves. Basically, if the player wants to move a piece somewhere, try the move real quick and see if the result would make the king be in Check. If yes, undo the move and cancel it.