Measure your packed cabin bag and check its dimensions and weight against included and paid airline allowances.
When one side of a cabin bag is too big
A 39 × 29 × 22 cm bag is too deep for a 40 × 30 × 20 cm limit. If the airline gives a maximum for each side, spare space along the other two sides doesn’t make up the 2 cm.