i have heard many people that if someone do a bad deed or commit a sin such as doing something bad to some other person. he will have to pay for it either in such a way that his childeren have to face the same situation. is it really true? does this really happens? and if yes then why his childres have to pay if they didnot done anything wrong.
QS. An Nisa: 9
"And let those [executors and guardians] fear [injustice] as if they [themselves] had left weak offspring behind and feared for them. So let them fear Allah and speak words of appropriate justice."
QS. Al Kahf: 82
"And as for the wall, it belonged to two orphan boys in the city, and there was beneath it a treasure for them, and their father had been righteous. So your Lord intended that they reach maturity and extract their treasure, as a mercy from your Lord. And I did it not of my own accord. That is the interpretation of that about which you could not have patience."
then Ibnu Katsir says:
"The above verse is a proposition that one's salih influences his grandchildren in the this world and the hereafter, thanks to their obedience and intercession, they are elevated to heaven so that both parents are happy as explained in the Qur'an and sunnah."
i guess in other word, if we arent not salih, let alone our children.
sorry bad english
Everybody is accountable and responsible for his own deeds or misdeeds
The Qur'an teaches us that none of us will be judged by the doing, wrongdoing or acts of other people in general, but based on our own acts saying:
"And every soul earns not [blame] except against itself, and no bearer of burdens will bear the burden of another. ..." (6:164)
"Whoever is guided is only guided for [the benefit of] his soul. And whoever errs only errs against it. And no bearer of burdens will bear the burden of another. And never would We punish until We sent a messenger." (17:15)
"And no bearer of burdens will bear the burden of another. And if a heavily laden soul calls [another] to [carry some of] its load, nothing of it will be carried, even if he should be a close relative. You can only warn those who fear their Lord unseen and have established prayer. And whoever purifies himself only purifies himself for [the benefit of] his soul. And to Allah is the [final] destination." (35:18)
"If you disbelieve - indeed, Allah is Free from need of you. And He does not approve for His servants disbelief. And if you are grateful, He approves it for you; and no bearer of burdens will bear the burden of another. ..." (39:7)
"Every person, for what he earned, is retained." (55:21)
"Every soul, for what it has earned, will be retained" (74:38)
What strikes us is from Allah and it is or can be a result of our deeds
We are also taught that anything that happens is from Allah and might be a trial or test for us and any thing that happens to us or strikes us has is related to our own deeds:
"What comes to you of good is from Allah , but what comes to you of evil, [O man], is from yourself. And We have sent you, [O Muhammad], to the people as a messenger, and sufficient is Allah as Witness." (4:79)
"Every soul will taste death. And We test you with evil and with good as trial; and to Us you will be returned." (21:35)
"Corruption has appeared throughout the land and sea by [reason of] what the hands of people have earned so He may let them taste part of [the consequence of] what they have done that perhaps they will return [to righteousness]." (30:41)
"And whatever strikes you of disaster - it is for what your hands have earned; but He pardons much." (42:30)
And as for man, when his Lord tries him and [thus] is generous to him and favors him, he says, "My Lord has honored me." (15)
But when He tries him and restricts his provision, he says, "My Lord has humiliated me." (16)
No! But you do not honor the orphan (17)
And you do not encourage one another to feed the poor. (18)
And you consume inheritance, devouring [it] altogether, (19)
And you love wealth with immense love. (20)
No! When the earth has been leveled - pounded and crushed - (21)
And your Lord has come and the angels, rank upon rank, (22)
And brought [within view], that Day, is Hell - that Day, man will remember, but what good to him will be the remembrance? (23)
He will say, "Oh, I wish I had sent ahead [some good] for my life." (24)
So on that Day, none will punish [as severely] as His punishment, (25)
And none will bind [as severely] as His binding [of the evildoers]. (89:15-26)
On the importance of repentance
The above quoted verse (42:30) already shows the importance of (sincere) repentance.
And it is He who accepts repentance from his servants and pardons misdeeds, and He knows what you do. (42:25)
In addition to these two verses I'd like to add a few ahadith on the topic which are quoted by ibn Kathir in his tafsir on verse (42:30) -see here in Arabic-on this verse.
Allah is more pleased with the repentance of a servant as he turns towards Him for repentance than this that one amongst you is upon the camel in a waterless desert and there is upon (that camel) his provision of food and drink also and it is lost by him, and he having lost all hope (to get tbat) lies down in the shadow and is disappointed about his camel and there he finds that camel standing before him. He takes hold of his nosestring and then out of boundless joy says: 0 Lord, Thou art my servant and I am Thine Lord. He commits this mistake out of extreme delight. (Sahih Muslim)
So it is strongly advisable for any person who has committed a sin to ask for forgiveness and seek repentance.
In Islam we believe that any bad thing that happens to us is a relief or expiation for some sins
In the sunnah we are taught that bad things that may happen to us may mean something good for us:
The Prophet (ﷺ) said, "No fatigue, nor disease, nor sorrow, nor sadness, nor hurt, nor distress befalls a Muslim, even if it were the prick he receives from a thorn, but that Allah expiates some of his sins for that." (Sahih al-Bukhari, see also in Sahih al-Bukhari this similar narration)
Strange are the ways of a believer for there is good in every affair of his and this is not the case with anyone else except in the case of a believer for if he has an occasion to feel delight, he thanks (God), thus there is a good for him in it, and if he gets into trouble and shows resignation (and endures it patiently), there is a good for him in it. (Sahih Muslim)
and in ibn Kathir's commentary on verse (42:30) he quoted:
Imam Ahmad recorded that Mu'awiyah bin Abi Sufyan, may Allah be pleased with him, said, "I heard the Messenger of Allah say:
(No physical harm befalls a believer, but Allah will expiate for some of his sins because of it.)"
Imam Ahmad also recorded that 'A'ishah, may Allah be pleased with her, said, "The Messenger of Allah said:
(If a person commits many sins and has nothing that will expiate for them, Allah will test him with some grief that will expiate for them.)" (Source of both quotes qtafsir)
See also this hadith from Jami' at-Tirmidhi which was quoted in Tafsir al-Qurtobi on verse (42:30)
Do children have to pay for the deeds or misdeeds of their parents?
Ibn Kathir in the context of verse (42:30) -see here in Arabic- quoted words of some scholars which seem to agree to your point among them:
In the following I'm translating from Arabic, as these translation is mine take it carefully!
عن أبي البلاد قال: قلت: للعلاء بن بدر : وَمَا أَصَابَكُمْ مِنْ مُصِيبَةٍ فَبِمَا كَسَبَتْ أَيْدِيكُمْ وَيَعْفُو عَنْ كَثِيرٍ وقد ذهب بصري وأنا غلام ؟ قال فبذنوب والديك.
From Abu al-Bilaad who said: I was said to abu al-'Alaa' ibn Badr: "And whatever strikes you of disaster - it is for what your hands have earned; but He pardons much." and my eyesight has gone when I was a young boy? He answered this is by the sins of your parents.
Note that none of these narrations ibn Kathir (mostly via connected chains) has quoted appears in the version of qtafsir, which leads to the interpretation that these kinds of statements have some weaknesses. At least it is not by default the case that the children pay for the sins of their parents. But it is rather a trial or test or reminder from Allah if He causes suffering to a relative of a sinner. Also note that sins by default can have effects on the surrounding of the sinner, especially if sinner and sin are known in the community. So the statement is possible but not to be taken as a rule of thumb.
Assuming these kind of trial happen to you if you were thankful or patient you might highly be rewarded according the hadith quoted above. Note that the trial that happens to a child also affects the parents so that they might be reminded by Allah of his gifts as he is giving and taking and they might repent.
Majmoo’ Fataawa al-Shaykh Ibn Baaz, 2/610
But the consequences of the sins committed by the sinner may go beyond him to affect his family, as a punishment for him and a test for his family. Allaah tests man with disasters in order to expiate for his sins, and Allaah may test people with blessings. Allaah says (interpretation of the meaning):
“We shall make a trial of you with evil and with good” [al-Anbiya’ 21:35]
Whatever the case, the Muslim must avoid sin so that he will not be subject to the wrath and anger of Allaah. And Allaah knows best. (Source Fatwa on islamqa #9047)