If your Queen is guarded, meaning the Queen is on a space that another one of your pieces could move to on the next turn legally, then the King cannot take the Queen as it would be illegally placing itself in check.