A move must leave your own king legally safe. Capturing an attractive piece does not override that requirement.
What to do
Identify the line or piece currently protecting the king. Imagine the proposed move, remove the moved or captured pieces from their old squares and check the resulting attacks before committing.
A mistake to avoid
Pinned pieces can appear to have ordinary moves that are not legal because the king would be exposed. Evaluate the final position, not only the moving piece.
A detail worth checking
After a capture, inspect the vacated square as well as the destination. Lines can open behind the moving piece, so a safe-looking arrival does not establish that the move is legal.
Try this practical check
Use a practice pin position and list candidate moves. Cross out every move that opens an attack on the king before considering material gains.
Related reading
6 Best Chess Books for Beginners and Improving Players (2026)