Let’s take a look at the Korean sentence pattern 괜히 + Verb. We use this to express regret because we did something we realized was unnecessary. For example, I used to have thick fore hair, but I decided to get rid of it and try a new hairstyle. However, it didn’t turn out the way I expected. I looked terrible. So I told myself I shouldn’t have cut it (I realized I didn't have to do it). The main verb is 자르다 (to cut) and its past tense form is 잘랐다. 괜히 comes before it. The actual sentence is 괜히 잘랐어 or 괜히 잘랐네.

괜히 말했어.

I shouldn’t have said it. (I just told her I like her. She has read the message but didn’t respond.)

밥 괜히 했어.

I shouldn’t have cooked. (if I only knew you were going to eat out)

괜히 왔네.

I shouldn’t have come. (I thought you said you were alone)