Hey there! I'll try to provide you with my best answer.
Answer: Atoms are the smallest particle of a chemical element that can exist. In the three states of matter, atoms in solids are tightly packed. And atoms in liquid are abit farther away from each other.
Basically what happens when they melt is that they gain a sort of heat energy. This heat energy comes from the fire or anything we are using to heat the solid material up. As we heat it, the tightly packed atoms vibrate. This vibration from even one single atom can cause other atoms to vibrate as well. As the vibration spreads and heat energy increasing if we constantly heat it, they obtain so much energy that at a point they start displacing from their position. This heat energy makes the atoms be in an excited state.They continiously hit each other and move farther away. They will keep on moving far until they stop gaining any heat energy. Eventually this slow process happens from solid to liquid. Just like how we see solid ice melt into water.
This cause an decrease in density. As in solids the atoms were very close to each other. But as soon as they are converting to liquid the atoms there has a gap between them. We can see this just like hold a solid object which doesn't move at all. But when water dropped at a place, this spreads wide out.
Hope it helps! And sorry for making it so long!