A rule that physicits discovered is that energy is conserved, which means you can’t create or destroy energy, but you can change it to different forms of energy.
When the ball is held up, it has a lot of potential energy and kinetic energy. As it falls, it strarts losing its potential energy and speeds up to get more kinetic energy. When it hits the floor it has no potential energy, but lots of kinetic energy. When the ball hits the floor the ball bounces back up to a height lower then it started, so after one bounce it has less potential energy is conserved some of that energy must have gone somewhere else. When the ball hits the ground, it gets squished, which causes friction between the different rubber molecules that make up the ball, and the friction heats the ball up. Because friction slows down the ball, it has lost some kinetic energy, and because it has heated up, it has gained some heat or thermal energy. The hotter something is the more thermal energy it has. When we see the ball bounce back up almost to its original height, we know that it is always a little bit lower than it started because it has transformed some of that original potential energy to thermal energy.