Both Luke and John recount the story of Jesus' death in their gospels, and there are no real points of disagreement or disparity between them. They do, however, include and omit different details of the story.
Luke's account is much longer and therefore more detailed than John's account. Starting with Pilate's release of Jesus to the crowds, Luke describes an unruly and cheering crowd through which Jesus must carry his cross. Jesus talks to those who are following him, telling them not to weep or mourn for him; instead, they are to weep for themselves because worse things are now ahead for them.
Luke spends a lot of time on the other two miscreants who are hanging on crosses next to Jesus; however, he does not even mention Jesus' mother or Mary Magdalene or the lone disciple, who are all mentioned in John's account. There is no mention of the piercing sword, but Luke records the immediate aftermath of Jesus' death--darkness and the ripping of the temple veil.
Some details are presented in both gospels: the soldiers casting lots for Jesus' robe, the crowd taunting Jesus to save himself if he is God's Chosen One, the offering him vinegar, the inscription written above Jesus' head, the promise of heaven for the repentant criminal, Jesus' final words asking forgiveness for those who are killing him, and the immediate aftermath--darkness and the ripping of the temple veil.
According to Luke 23:46. Jesus' last words were
"Father, into Thy hands I commend my spirit."
John records Jesus as saying
"It is finished" (John 19:30).
It is true that the two accounts are not exactly the same; however, it is unlikely that two people attending any event would match stories precisely because each would have seen it from a different perspective. In the big picture, however, the two accounts match. Each man chose different elements of the event to capture in a written account, so we get details in one that we do not get in the other. Despite that, both accounts are strikingly similar.