Mary, Martha and most likely Lazarus were wanting an immediate healing for Lazarus. 
Instead Lazarus died. Where had Jesus been when they needed him? Why wasn’t he there at that moment? 
The news of Lazarus’ death traveled around. Probably some doubted Christ’s power; if he couldn’t heal his friend what kind of man was he?
But then Jesus raised Lazarus from the dead. Many Jews–previous doubters–began to follow Christ because of this miracle he had performed.
Why wasn’t Jesus there at that moment? He was setting the stage for a greater impact to be made. Where had Jesus been? He had been waiting for a greater miracle to play out for Lazarus and the people that were watching everything transpire.  
Jesus was right where Mary, Martha and Lazarus needed him to be the entire time. They got the end result they were after; it was just on God’s timetable and part of a greater plan. 
Jesus has your greatest good in mind. He knows the best plan to get the best results. Hold on. Keep loving him because he loves you. 
Scripture taken from:

John 11 & 12:1-11