I was impatient (yes one of those 'busy' days). A co-worker only went on a simple 30 minute errand and did not return for hours. I sent a message to our group chat asking if he was still running the errand and he said he'd do it only then. As our team was on a very tight schedule and was waiting for him to return to proceed. Impatiently I asked him on chat, where was he before that with lotssss of question marks. It turned out he had a family matter to rush to. I later received a warning from my boss not to put my co-worker on spot like that. Thinking back, I could have opened a private chat instead. I felt horrible and it doesn't help that I'm also a new rookie to the workplace. What's the best way to apologize or a good method to keep your cool when you're impatient?
I'm not seeing a problem here that would require you to apologize to your co-worker.
Your co-worker left on a 30-minute errand, then had an emergency come up. It happens. But then your co-worker apparently didn't bother calling work to inform you there was an emergency and kept you in the dark for several hours, during which time you were apparently at a total work stoppage. You didn't put him on the spot; he put himself on the spot.
If he called work, but your bosses failed to inform your team, it's on them. But it certainly isn't your fault. Nor were you acting "impatiently" by asking what the hold-up was several hours after he was expected to be back. If anything, I'm wondering why you waited so long. Where I work, if you're 20 minutes late, we're calling you (that's about enough time to miss your bus, catch the next one, and be at work). Some places I've worked you'd get a call within 5 minutes.
Is a question with lots of question marks rather informal and a bit on the juvenile side? Sure. Is it unprofessional? A little, but not really. Could you have asked via private message? Sure. Should you have? Maybe. Is it really a big deal? No.
The bigger problem here is that you had a work stoppage and apparently didn't escalate it to your supervisors, who may have been able to help you work around the issue. Your next step should be asking your supervisors how they would prefer you handle situations like this in the future.
Personally, if a co-worker is late, I go to my supervisor and ask, "Hey, did you hear from John Doe? His shift started 20 minutes ago, but I haven't seen him." This lets my supervisor know there's a problem, that they may need to assign personnel to help me, and that they should find out from John Doe what the hold up is and if/when he's going to be in today. It also gives them the chance to inform me, "Oh yeah, he's running late. He'll be here in about 30 minutes," so I can react properly or ask for help if needed.
There no reason you can't tell your co-worker, "The other day, you didn't show up for hours, and didn't let anyone know what was going on. You should have handled the situation better, but I could have handled the situation a bit better too, so, sorry about that." But the fault really seems to be your co-worker's. So I wouldn't worry about it too much.
In general, it's not a good idea to discipline employees in front of a group for personal transgressions. It's acceptable at times if the group needs to hear the message, because it applies to all of them, and many of them are infringing/possibly infringing. But in this case, the message was clearly intended for one person only, and should be delivered that way. As you can see, you don't know what the story is until you know what the story is.
Your apology should be public as well. Anyone who saw this on the chat should know that you were wrong, and that separated from your concerns at the time, your behavior wasn't acceptable. Don't castrate your own apology by reinforcing that you need to be notified if there's an emergency, or that things need to get done.
As for your question about "a good method to keep your cool when you're impatient", the act of making the personal and group apology will help you learn to avoid this mistake again. In addition, if a normally reasonable person isn't acting reasonably your first reaction should be to treat the situation as if there were a valid reason behind the situation. Reacting this way will come to be instinctual if you practice it every day (such as with rude drivers on your commute).
I see several problems:
1) expected time of errand was 30 minutes and you waited hours before asking him.
2) you should have asked him in private chat not the group chat.
3) you should inform your boss that you are blocked until the errand is finished (whether you got response or not)
4) You've used more than one question mark. Don't do that. - I cannot stress this enough!