How it is possible for astronomers to find out when the end of the Sun's life will be?
Yes, astronomers could be wrong. Part of being a scientist is always having to be ready to admit that you were wrong.
Astronomers have developed models of how the sun and other stars work. We understand them to be nuclear furnaces. These models may not be perfect, but they are well supported by the evidence and can predict much of what we observe from the sun and other stars.
Using these models we can expect the sun to exist for about 10 billion years, and it is currently about 4.7 billion years old. While the model could be wrong, it is probably not very wrong, and the sun will go on shining for a long time yet.
To understand stellar evolution (the life cycle of all stars, including our Sun), we start by simply looking at all the stars. We can find out what they are made of and what temperature they are by looking at the spectrum - different elements emit and absorb different wavelengths of light, and the brightness gives us information about temperature. Over hundreds of years, we have then developed models of stars and tried to fit them to explain how many of different types of stars we can see. The models that fit well we keep and refine, the ones that don't fit reality we discard. There are still things we don't understand about stellar structure and evolution, but our Sun is a rather well understood type - it is low to medium mass, and in about the middle of its life. We can't predict to the day or year or hundred years exactly what will happen, but we can predict to around a billion years accuracy when it will run out of hydrogen fuel, swell up to a red giant, and then explode as a supernova and become a white dwarf.