Sumimasen is a formal and sincere way of apologizing. It can be used when offering an apology to anyone, even to strangers. The Japanese use gomennasai, which also means (I'm) sorry, when apologizing to someone they know personally, like family and close friends. Sumimasen can also be a thank you as well as an apology.