People who sleep badly are not all fat. Some people have poor sleep, accompanied by anxiety, eat less, and may lose weight. So obesity is a comprehensive factor. Generally speaking, if you eat more, exercise less, and consume more energy than you consume, this is the most likely cause of obesity in physics.
I still advise you, if you have sleep problems, actively come to the hospital to see a doctor and rule out some organic reasons. If it is a simple sleep disorder, you can also use some anti-insomnia drugs to help regulate sleep.