What is the meaning of [It’s better to be safe than sorry.]

It’s better to be cautious than regret later.

Example: One shouldn’t complain about the inconvenience of security check each time you enter the building. It’s better to be safe than sorry.