In the Old Testament, animal sacrifices were a representation of the true future sacrifice of Jesus. These Old Testament animal sacrifices were not able to cleanse anyone of their sins (Heb. 10:4). Yet, they were offered as a predictive representation. In other words, they were a type, a representation, a picture of the final and real sacrifice that was to occur when Jesus died on the cross bearing our sins in His body (1 Pet. 2:24).
In the Garden of Eden after Adam and Eve sinned, God covered them with animal skins (Gen. 3:21). This was the beginning of the animal sacrifice system, and it was instituted by God. The amazing thing is that it is also God who is the one who fulfilled this sacrificial requirement by becoming one of us (John 1:1, 14), bearing our sins in His body on the cross (1 Pet. 2:24), and cleansing us of our sins (1 John 1:7). All of the Old Testament sacrifices pointed ahead to the real one offered by Jesus. This way, the Old Testament saints could by faith trust in God's provision: "The just shall live by faith," (Hab. 2:4), and "Then he [Abraham] believed in the Lord; and He reckoned it to him as righteousness," (Gen. 15:6).
So, it really wasn't that the animals were dying for anyone's sins. They simply were a type of the true sacrifice made by Christ.