Get one's fingers burned / burnt
At one time or another, we have all burnt our fingers either cooking, tending a fire, or striking matches. It is not a pleasant experience. Hence, when we use the expression figuratively, it signifies some unpleasant experience or other that is essentially one's own fault. The expression has been used in this figurative sense since the mid-1600s.