How does the intl. community act to prevent or encourage govs. to change behavior

Assume a country is acting in a way that is considered inappropriate on the global scale (North Korea engaging in kidnapping & the drug trade for example), or is treating its own people in a way that violates most people’s sensibilities (Myanmar’s human rights abuses). What all methods are there that are used by the international community to pressure that state to reform?
Offhand I would guess they can:

Impose sanctions, prohibiting trade either with all UN countries or with the country imposing sanctions

Cut off financial aid in the forms of grants and loans either from the UN agencies or the agencies of that particular country

Threaten military action

I assume the opposite would be to offer grants, loans & remove sanctions as well as offering scientific expertise to the domestic government if they reform.

I don’t know what else they can/would do.

However how do these things actually hurt the government itself or pressure the government to change it’s behavior? These seem like they’d slow down economic progress, is the goal to make life harder for the people so they will revolt and to make the domestic government more unpopular? Or is it just a moral issue where one government says to another ‘if you’re going to act this way we won’t help you’ and in and of itself is pretty ineffective at bringing change?

Do countries act this way to actually bring about a change in behavior? It doesn’t seem to work (North Korea and Iraq are good examples), then again I think it has worked in Libya so who knows.