There are also medications for a dog with anxiety disorders and neuroses, but if the trigger is not found, these are not always a long-term solution. In the case of acute panic attacks, the dog should definitely be protected long enough for the medication to take effect so that he does not hurt himself. If you have to leave your dog alone during the day, you should consider whether someone can look after him in your absence.
During the medication treatment of the dog, the trigger should be found. During the first period of treatment, the dog must be kept away from fear-inducing factors and stress.

Dog with anxiety disorder
Behavioural therapy for dogs
Many dogs respond positively to behaviour therapy. As his owner and friend, you can do this yourself. Teach your dog to relax and be there for him when he shows fear or panic. However, you must not "reward" the dog by showing too much intense affection during his attacks, otherwise he will learn that this behaviour brings him extra care. Under no circumstances should a dog be punished for its neurotic behaviour. Avoid anything that aggravates his anxiety.

Desensitisation
Desensitisation and counter-conditioning have proven effective in treating anxious, neurotic and disturbed dogs. First, the trigger of the gnawing must be minimised. The goal is to bring the dog into repeated and regular contact with the fear trigger, but only in a controlled manner. Through counter-conditioning, the dog is taught a positive behaviour in response to the fear instead of the negative behaviour.
Instead of tucking his tail and running away, you can train the dog to sit and stay beside you and then reward him profusely for his behaviour. First train him while he is relaxed so that he learns to associate the reward with his behaviour. Then, if a fear attack occurs, command him to come to you and sit as he has learned. It is important that you recognise the signs of the anxiety attack in time, before the dog gets into it.
Anxiety disorders and phobias in dogs
My dog has anxiety I Training tips for a dog with anxiety disorder

