This is another one of those apparent contradictions that arise when comparing different gospel records of the same event.
While [Jesus] was saying these things to them, behold, a ruler came in and knelt before him, saying, “My daughter has just died, but come and lay your hand on her, and she will live.” (Matthew 9:18)
But the other gospels say she had not yet died:
Then came one of the rulers of the synagogue, Jairus by name, and seeing him, he fell at his feet and implored him earnestly, saying, “My little daughter is at the point of death. Come and lay your hands on her, so that she may be made well and live.” (Mark 5:22-23)
Later (in Mark and Luke), Jairus is told that his daughter has died and then Jesus raises her from the dead.
This seems to be a typical case of Matthew compressing the record. He does this often. In this case, it seems that Jairus pleaded with Jesus to come and heal his sick daughter. A messenger arrived to say she had already died, and Jesus tells Jairus “Don’t be afraid; just believe”. No doubt Jairus said something like “But my daughter has just died”, as it seems (from Mark and Luke) that he didn’t consider resurrection a possibility. Matthew conflates and rearranges the conversation which gives the impression that Jairus knew his daughter was dead before he first spoke to Jesus.
This sort of compression of narratives bothers western ears because it is contrary to our accepted standards of reporting events. However, it seems that it was perfectly acceptable in first century Israel, and would not have been considered contradictory.