The goal is to make the cost of waging war increasingly painful to pay. There is no other way to effectively do this than to target the entire country.
Off the top my head, the sanctions on Iran were pretty effective to get them to negotiate the nuclear deal. Until Trump tore that one up, that is.
You asked for an example of a country changing its attitude, that is what happened in Iran to negotiate the nuclear deal. Now you are moving the goal posts and claiming that it wasn't sufficiently successful in the long run. That may well be, but it has nothing to do with the presence or absence of sanctions.
I also want to point out that sanctions often work far more subtly than what you imagine. If six months from now, Ukraine and Russia engage in successful peace talks, sanctions will certainly have played a role in shifting Russia's position closer to that of Ukraine, but on the surface it will be impossible to tell by how much.
Sure, I said it was one example, I just added context afterwards. I also asked for examples, not just one which has seen zero other impact except hurting the citizens.
No need to guess about what might happen, we can look at past sanctions instead.