1) Jesus' mother Mary was left without family when Jesus died, so Jesus asked his disciple John to take Mary into his home and care for her.
2) As Jesus was dying on the cross, he saw Mary standing there grieving. He said to John "Here is your mother" and to Mary "Here is your son", entrusting Mary's care to John.
3) Mary then went to live with John for the rest of her life, cared for as Jesus wanted.