Hi guys, i'm not sure if this topic fits here, but can anyone tell me about the origin of planets? Like how is our planet formed?

I'm not the best person for this stuff but I'll take a stab at it anyways. I'm pretty sure this is the mainstream account of planet formation.

When a nebula collapses due to some sort of nearby disturbance it creates a cloud disk. This cloud disk of a bunch of particles/elements after quite a bit of time through the gravitational interaction of the particles/elements will form a star.

In other parts of the cloud disk gravity is using materials not going to the star to form planets through the same gravitational interaction. The terrestrial planets were formed from rocky dense elements. These elements mostly form the core of the terrestrial planets (cause they are heavier so they travelled further into the clump of particles.)

The gas giants were made the same way difference being is that in the outer solar system icey particles/elements were around in larger quantities. They formed the cores of the outer planets... and since there is a lot of hydrogen/helium out there too they cause the planets to continue to grow. (Pretty much the same as the stars formation) Jupiter and Saturn are composed of large quantities of hydrogen/helium and Neptune/Uranus are composed of large quantities of the icy particles from before.

The moons are probably formed around the same time or possibly they are captured bodies that were floating around.

Anyways I hope what I've posted helps you, you should probably wait for one of the more knowledgable people around PF to give it an approval stamp or make alterations to it.

The elements that make up the icy outer planets would evaporate under the heat of the sun and therefore can't make solid planets. These were instead transported outwards by various mechanisms.

The distance at which the temperature is low enough for the ejected material to condensate is called the "frost line" and coincides, not accidentally, with Jupiter's orbit. Once they condensate they will start to lump together and form planets.

The elements that make up the icy outer planets would evaporate under the heat of the sun and therefore can't make solid planets. These were instead transported outwards by various mechanisms.

Ah, no. They condensed from gas phase wherever it was cold enough onto the already solid dust. Most of the condensation happened in the pre-solar nebula. Once the sun began forming a central mass, the nebula dust/ice collapsed into its rotational plane, then began forming clumps under the influence of the ambient gas and its own gravity. Between the size-range of dust and planetoids there's a lot of unknowns, but basically the cores of the gas giants formed objects much like gigantic, icy versions of Earth, then their gravity pulled in a lot of additional gas from the nebula. This happened pretty quickly for Jupiter and Saturn, but not quick enough for Uranus and Neptune, since they're only a small fraction hydrogen/helium.

The distance at which the temperature is low enough for the ejected material to condensate[sic] is called the "frost line" and coincides, not accidentally, with Jupiter's orbit. Once they condensate[sic] they will start to lump together and form planets.

More or less what I said. But without any "ejection". The Sun began "ejecting" a very heavy solar-wind in its T-Tauri phase, which blew away the Hydrogen/Helium gas, but this happened after the cores of the gas giants had formed.