No, the earth will never merge into the sun because it has a certain velocity while it revolves in space. The space has no air which means no friction. So eventually it tries to fall every year but never reaches its destination. In case of planets we can assume that the average speed of particles were around 1037 mph which might be not sufficient for it to resist the gravitation force of the planet. This is the same concept we use to launch a Satellite around the earth. The speed of a satellite that keeps revolving around the earth is around 17500 mph. So we can assume velocity and various other factors could be the cause why particles got merged forming planets while velocity is the reason why earth or any other planet is not merging into the sun. Please check out this video on the topic for reference video