I'm pleased to join HappyHelper88 in welcoming you to the Support Forum. You are a very capable and thoughtful person to seek advice and your freind is lucky. I'd have to say the HappyHelper88 has covered the situation well. I'm also pleased that your avatar is not in fact a picture of a sinking ship:)
As to what to do, that will vary and is best described by the medical professional treating your friend. This may require your friend's permission, though there is nothing to stop you gaining "general advice" from that professional. I'd suggest you do this promptly in case of another onset.
Beyond that the first thing to do is ensure your friend is in safe, quiet and comfortable physical circumstances with unobstructed airways and ensure if their catatonia involves movement the do not injure themselves.
It may well be you friend may be disoriented, frightened or confused when emerging from such a state and having someone familiar nearby who can care for them, reassure and explain as needed can be very helpful and soothing. Similarly help with simple tasks may be needed.
There is also nothing wrong in asking your friend what they need.
So far we have talked of a recovery situation, if an episode starts then seek medical help straight away, unless instructed otherwise by your friend's psychiatric support.
Actually if you do manage to to find further information we would be very interested