There are at least two types of cases where the New Testament quotes the Old Testament. The first type is where the Old Testament predicts something important that is to happen in the future, and the New Testament quotes that Old Testament passage in order to tell us that particular prophecy has been fulfilled.
We might break this first type into two categories, the simplest case being where there is only New Testament fulfillment, and the second category where there is dual fulfillment. A classic example of the former can be found in Gen 12:3 where God told Abraham that “in thee shall all families of the earth be blessed.” That sentence is quoted in Acts 3:25-26 to say that Jesus is its fulfillment in that Jesus’ death for sins is a blessing to every family on earth – both Jew and Gentile.
A good example of dual fulfillment is found in Psalms 22:1 where David states “My God, my God, why hast thou forsaken me?” David was forsaken by God at least in the sense that God would not hear him when he cried out (verse 2). But more important is the second fulfillment when God the Son was forsaken by God the Father according Matt 27:46 where Jesus quotes Psalms 22:1 applying the words to himself and his crucifixion. Not only was Jesus forsaken physically (God did not rescue him from the cross), but also spiritually (Isaiah 59:2) because the “Lord hath laid on him the iniquity of us all” (Isaiah 53:6).
The second type of New Testament quote of the Old is where an Old Testament phrase is not prophesying of something in the future, but the New Testament author adapts such Old Testament phrase to appropriately describe something completely different in New Testament times. An example of this type case can be found in Gal 4:30 where Paul uses the words “cast out the bondwoman and her son” from Gen 21:10. Those words in the Old Testament are describing what Sarah wanted done physically with Hagar and Ismael, but Paul accommodates those same words in Galatians to describe the fact that the Old Testament law (represented by the bondwoman Hagar) is no longer binding during our new covenant dispensation.
One thing we need to be careful about is speculating about New Testament fulfillments of Old Testament texts when we are not told by God one is a fulfillment of the other. That can lead to many false conclusions.