Below is a figure which shows the bulk composition of Earth. We measure the composition of the Sun using the properties of the light coming from the Sun. The effect is that sunlight's rainbow will have thin dark lines in it. This technique is called absorption spectroscopy . By applying absorption spectroscopy to the Sun, we find that the Sun is very rich in hydrogen and helium, with lesser amounts of other elements.
Meteorites are chunks of rock and metal left over from the earliest history of our solar system.
They are believed to be samples of the original nebula which formed our solar system. Putting it together Since carbonaceous chondrites are found on Earth's surface, we can take them into the lab and directly measure their chemical composition. Obviously, we cannot do that with the Sun, and are left with our results from absorption spectroscopy. The answer is yes, except that the Sun has much more hydrogen and helium than do the meteorites, which makes sense since the Sun is a huge gas bag. So, we know that the Sun and chondrites have very similar bulk compositions.