As with everything else in our lives the most important thing is to find a balance. You know how they say, every poison in small doses is a medicine and every medicine in large doses is a poison. Some people even recommend drinking a glass of wine after the lunch.
At my previous job I was working night shifts (midnight to 8 am), and my problem was that my soul was sleeping at around 4-5 am but after 6-7 there would be sunrise and I was sharp awake and I couldn't sleep. So I find out that if I drink one beer after the shift I would sleep like a baby

It is self-deception. If you have insomnia then this is most likely due to the fact that you had some thoughts which did not allow you to disable the brain activity. Alcohol just relaxed. Gradually the dose will need to increase and this can lead to alcoholism.