I think this is a very difficult thing to answer generally, which is why the research of sanctions is pretty mixed.
Typically you have two types of sanctions. Direct military sanctions, aiming to restrict the availability and/or production of weapons, and various types of economic sanctions, aiming to lower GDP. By lowering GDP you also lower the tax base, meaning the government has less money available to fund the war. Whether or not this actually impacts the funding on the war depends on how motivated the state is to wage war, and on how tight a grip it has on its populace. Unless the sanctions literally collapse the economy, which is basically impossible for a large country, it can simply choose to spend less money on non-war things or increase income by new/higher taxes, even money printing in the short term. The more authoritarian the state is, the less effective sanctions should be in changing behaviour.
Another problem is that the cost of sanctions is typically already taken into account by the country on the receiving end, and therefore it's not going to change behaviour. The ways this can end up not being true is if, 1. the sanctions are not announced in advance (which would be a failure on the part of the countries implementing the sanctions), announced but not taken as a credible threat (another failure), or both announced and taken as credible, but that the ones on the receiving end misjudge how costly the sanctions will actually be (possible).
As far as I know, most of the pro sanction research places a lot of weight on the deterrence factor: that the main way sanctions work is by preventing things from happening in the first place, not stopping things that have already started. This means that when sanctions have to actually be implemented, then they have already mostly failed. You still have to do it, because if not then you lose credibility and therefore the effectiveness of future deterrence.