Hopefully, it's never going to happen to you, but there is that remote possibility that your rat escapes from it's enclosure, or in some way becomes lost. Hopefully, you have an appropriate type of cage set-up, that the rat is never left unattended loose in any environment, and that we're always paying attention to try and decrease the likelihood that they should ever escape, get loose, or become lost.
In the event your rat becomes lost, the most important thing to remember is that if they're social and friendly and they're within your home, there's a very good chance that they're not going to just try to hide. There's a very good chance that they're not going to just try to escape, but they may actually want to find their way back to their cage or stay in a familiar area.
People who have sometimes come home and found that their rat has gotten out of the cage, often find that the rat has stayed around the cage or stayed in the room or the vicinity and hopefully it's an area where, if the rat gets out of their environment in your home, they can't escape from your home and become lost.
Should you come home, or should a rat escape from you inside of your house and become lost, the first thing you're going to do is devote time to try and find them. They're not going to hide, they're not going to be fearful, and it may not be that difficult to actually be able to find them. You're going to have to check in places like under sofas, check in closets, look for any areas that they may squeeze into and squeeze through, keeping in mind that rats are very good about getting into very small spaces and squeezing through very small openings.
Ideally, if you're outside of your home and the rat were to become loose, hopefully this never happens if you're using an appropriate carrier, but if you were to loose your rat, chances are, if they can run and they can scamper off, there may be a good chance they may be lost permanently.
So, ideally, an appropriate cage, appropriate cage door locks, an escape proof environment, and an escape proof carrier are going to guarantee that this isn't something that happens. But should you find that your rat has somehow escaped their cage and gotten loose, you're going to have to devote some time looking for them, hopefully finding them and returning them, and correcting how they may have gotten out of their cage. Remember that bar spacing in cages is very important, cage locks and reinforced doors may be important for some rats, and making sure that nobody accidentally has come through, handled them, and not put them back in the cage properly.
If you lose them, chances are you'll find them exploring the home. They're very curious by nature. Ideally, in a situation that they can escape your home, you'll find them, return them, correct how they escaped, and make sure that you don't lose them again.