Actually, you are not unlucky, but you don’t really know yourself, and the people around you don’t really know you, so you have such an experience. If you don’t study well, it’s because you study under pressure instead of studying freely and voluntarily. If you are not in a good mood, how can your results be satisfactory? The grass growing under the rocks will not be straight. Your parents beat and scold you for the following reasons: what you do is not what they want and their demands are too high; what you did is not right; your parents are in a bad mood and take their anger out on you. Fortunately, those so-called good friends of yours are no longer with you, otherwise you would have been really led astray. You should not be with them again in the future, it will be harmful rather than beneficial to you. A true friend is not like this, he will help you, not lead you to fight.
The most important thing for you to do now is to find some psychology books to read. Don't complain about your parents, others, or yourself, but rebuild your confidence, find your own interests, study hard, and don't care what others think. As long as you don't hurt yourself and others, you are the best. People have to look forward. Edison, Einstein, etc. were also scolded as "waste" when they were young, but they became great men that no one can match. Just because they had unique experiences, their achievements will also be unique (find some information about them) In terms of books, read more humorous books, go online less, and don’t play games, this is the most important thing)! Remember to find out your own points of interest, keep a cheerful attitude, treat your parents calmly, and wait for them to calm down before asking calmly, "Mom and Dad, can you tell me what I should do to make sure I don't go wrong, so as not to make you angry?" , I am your son/daughter, and I need your teachings." The tone should be calm. You can find books in bookstores, psychology, humor, or you can ask on this platform. I hope you can maintain a peaceful mind, don't get excited when talking or doing things, deal with things quietly, and impress your parents with yourself like this. Some people's tempers are personality problems, which means they cannot be changed, so it is best not to confront others head-on. Your parents tend to have this tendency in their personalities, so don't worry about it and just listen to what they say is reasonable.
I wish you happiness!