When Jesus received the message concerning Lazarus, He was abiding beyond the Jordan river at the place where John first baptized (John 10:40). Bible students argue as to where exactly this was, but He was from 20 to 40 miles from Bethany, the town of Lazarus. It probably took Him at least two days to make the journey. It involved the crossing of the Jordan and a steep climb in a desert wilderness. If He were closer to 40 miles away, it would have probably taken three or more days. He would also have been slowed down by the many who "resorted unto him" (John 10:41). Another factor is the time it took the messengers from the sisters to find Jesus. In our day of electronic communications, we assume that they knew exactly where Jesus was and immediately found Him. This may have happened if He had left exact information as to His whereabouts. However, this is not a given. The messengers may have searched for four or five days to find Jesus.
What we do know is that leaving earlier would not have gotten Jesus to Lazarus before he died. If he had left immediately, He would have found Lazarus two days dead. His patience in the time of the death of His friend shows His knowledge of all things. He knew what He would do and He knew that it would be more powerful if Lazarus had been dead four days instead of two. The God of heaven and earth never needs to get in a hurry.