"Father, into your hands I commit my spirit."
When Jesus comes to his last moments of survival, the environment starts to go haywire and everything is being destroyed where he was and at the temple. The temple was being destroyed because of his last breath of survival to be sent to God. When Jesus says "Father, into your hands I commit my spirit," he is saying that he is ready to be with God and go into his kingdom. After he says this he dies immediately.
Jesus is saying that he wants God to take him away in peace and harmony. He wants the Lord to take his spirit in his hands and take him into the promised land. He doesn't want to endure the pain anymore and wants to be with his father. Jesus is now dead but his spirit is not gone. His spirit still lives and he will be back to prove to everyone that he will never abandon them.
This teaches us to trust God with our full selves, even at the hardest of times. There come times in our lives when we have done all that we can and the best thing to do is to simply give our lives to God and let him take control. For example, if someone's family member dies and there is nothing more that they can do, the best thing left is to just trust God to take care of them through the hardship.