By examining the code flow and expected versus actual results.
Logic errors occur when the code doesn't behave as intended, despite being syntactically correct. For example, if a discount is supposed to reduce the price but instead increases it, checking the flow and calculations can reveal this. Consider: 'double discount = 0.1; total = price + discount;' should use '-' to subtract the discount.