The nursing staff are always very careful and gentle with animals; they are specially trained to deal with this kind of situation, as is the new generation of vets. Because guinea pigs are small animals, they are these days most commonly put to sleep in a little container that is also used for anaesthetising for operative procedures (they just get a bigger dose so they do not wake up), so you are not allowed in this area even without the pandemic. The UK expression 'putting to sleep' is quite literally that - Cookie would have very gently drifted off.
The other method to put piggies to sleep is by injection while you are with her; but that can be even more upsetting for a loving owner; again, the piggy is anaesthetised first so they won't be conscious by the time they are getting the second, lethal injection, which is working in a matter of seconds. I have often made the experience that a piggy of mine dying at home would pass away the moment I put the cosy down to go to the toilet for some by then very urgent business; it seems that it is often easier for them to let go when we are not with them even though our own instinct runs counter to that.
Your can read up more on the details and how euthanasia is handled in this guide here:
A Practical and Sensitive Guide to Dying, Terminal Illness and Euthanasia in Guinea Pigs
Please also be aware that this kind of soul searching you are currently experiencing is typical for the onset of the grieving process. There is nothing you have done wrong, and Cookie has at all times been in loving and caring hands.
This guide explains the grieving process so more to help you understand your experiences and often unexpected feelings better as you go along. I hope that you will find it helpful:
Human Bereavement: Grieving, Coping and Support Links for Guinea Pig Owners and Their Children