Do cats know about euthanasia?
Cats can sense when they are being euthanized. Cats are inherently sensitive animals, so it's recommended that owners inform their cats of the decision to euthanize them. If the cat resists, it's best to stop the euthanasia. Purchase pain medication to alleviate its suffering, and if possible, hold the cat on your lap, gently stroke it, and accompany it in its final moments. 
Cats know before euthanasia
Regardless of their personality, cats are all very sensitive and understand whether they will die or be euthanized by their owners. When an owner prepares to euthanize their cat, the cat will sense the owner's emotions.
Therefore, when preparing to euthanize a cat, it is recommended to tell it about the decision. If the cat shows strong resistance, it is best to abandon the idea of euthanasia, buy some painkillers to alleviate its pain, and accompany it for the rest of its life.
When a cat is in great pain, its body is at its most vulnerable. If euthanasia is not performed, it is best to stay by the cat's side at all times if possible. You can also hold the cat on your lap and gently stroke it, so that the cat can feel its last warmth.