An example of naskh in the worldly sense could be that driving outside a school, the speed limit starts off with 30mph. Over time, people might realize that there are accidents in this area, and decrease the speed limit to 25mph. Similarly, naskh has been used in our traditions as well, both broadly and particularly. An example is that every Prophet who came to this world with their Shariah had abrogated some laws that were given in previous Shariahs, by the will of Allah. It is true that all of the Prophets brought the same concepts- the Oneness of Allah (SWT), basic ways of worshiping, the idea of the Afterlife and how we will be judged based on our deeds in this world, fulfilling the rights of others, etc. However, in some other aspects, abrogration takes place, where the most current Shariah becomes the most dominant one. This is even to the extent that when Isa (AS) comes back to earth, he will be following the Shariah of Prophet Muhammad (SAW), as he will then be a part of his ummah.
An example of laws being replaced is that in previous Shariahs, people were allowed to do sajdah to other people of authority out of respect, but in our Shariah we can only prostrate to Allah (SWT) and no one else.
Abrogation did not only occur from Prophet to Prophet, but it also occurred within the lifetime of the Prophet Muhammad (SAW) too. This was unique to the Prophet (SAW) because for the previous Prophets, the Books came all in one go, whereas the Quran was revealed over a long period of time. An example of naskh taking place in the Quran is that in the very beginning of Islam, the prayers that are mandatory upon us now were not mandatory at that time. The prayers became mandatory after the Isra al-mi'raaj, which was 5-6 years into prophethood. It was a gradual process, and people prayed Fajr and Maghrib together. In the initial stages of prayer, certain things were permissible, such as replying to a salaam, shaking someone's hand if greeted, etc. It was a very different kind of ibadah. Then, the prayer evolved to how it is now, where we are not permitted to interact with others.
The reason for the changing of laws over time was also to make it easy for Muslims to follow Islam in a gradual manner. Quoting Imam al-Qurtubi, the great Qur'an exegete Maliki jurist and hadith scholar, who said in his tafsir of the Quran:
The prohibition of alcohol occurred in stages and [after] many incidents, for they [the Arabs] used to love to drink it. The first [verse] revealed regarding the matter of alcohol was: "They ask you about alcohol and gambling. Say: 'There is great sin in both although there is some benefit for people…" [Baqarah:219] i.e. [benefit] in their trade. Hence, when this verse was revealed, some people left [alcohol] saying, "We have no need for that in which there is great sin," and some did not leave it saying, "We take [from its] benefit and we leave its sin." Thereafter, the verse was revealed: "Do not approach prayer while you are drunk…" [Nisa:43] So some people left it saying, "We have no need for that which distracts us from the prayer," and some drank it outside the times of prayer until the verse was revealed: "O you who believe! Alcohol, gambling, [sacrificing for] idols, and divining of arrows are only an abomination [of Satan's work…]" [Maidah:90-91]So [alcohol] became prohibited for them such that some of them said, "Allah did not prohibit anything as strictly as alcohol."
There is another example naskh - the takbeeraat, where Imam Abu Hanifa concluded that we should just raise our hands up in the beginning of prayers. There have been narrations in various ahadith that the Prophet (SAW) would raise his hand in takbeer after his ruku, or after his second sajdah. However, Imam Abu Hanifa claims that these takbeeraat were done in the beginning of Islam, and were slowly lessened, until there was only one time when the hands were raised for takbeer; in the beginning of salah. The Shafii and other madhabs have different opinions though.
There is also the example of the direction of the Qiblah, which used to be Jerusalem. Rasul Allah (SAW) had an attachment with the ka'bah and he would pray in such a way that he would face Jerusalem and the ka'bah at the same time when he lived in Makkah. When he moved to Medina, however, this was not possible because the two were in different directions. For the first few months in Medina, he (SAW) faced Jerusalem but still missed facing the Qiblah. Then Allah (SWT) revealed in the Quran that the Qiblah has changed towards the ka'bah now.
Now that we understand the term naskh it is important to realize that we cannot just go up to a hadith, for example, and follow it on our own accord without a deeper understanding. People in this day and age just pick up a hadith and they have no idea of the history behind it, or how to apply it, or if it's abrogated. You need to be a scholar of hadith in order to interpret it. Scholars categorize according to principles, and are consistent with it throughout. An example is that Imam Abu Hanifa has a principle that the Quran is the highest source of authority, and cannot be abrogated by something of less weight. For instance, it says in the Quran that it is obligatory during wudhu to wash your hands and arms up until your elbows, wash your face, wipe over the head and wash feet. However, in certain ahadith it is narrated that the Prophet (SAW) sometimes while traveling wiped over his turban rather than his head (seemingly). Imam Abu Hanifa's understanding is that this isn't proof enough to allow men to wipe over turbans because the Quran is of more weight. Therefore, learning about abrogated texts is an essential part of religion, and it is why we cannot randomly derive Islamic law.
This particular ayah is based on an incident that occurred after the direction of the Qiblah changed. The Bani Israel asked the Muslims that why would Allah, who Muslims claim is All-Knowing, suddenly change His mind about something? The Bani Israel mocked the Muslims about this issue. They asked if Allah was wrong first then corrected Himself (naudhubillah). This is how they would confuse the sahaaba at that time. The ayah that was revealed beautifully to inform Rasul Allah (SAW) about the changing of the Qiblah was 144 of the same surah, " Verily! We have seen the turning of your (Muhammad's SAW) face towards the heaven. Surely, We shall turn you to a Qiblah (prayer direction) that shall please you, so turn your face in the direction of Al-Masjid- Al-HarĂ¢m (at Makkah)." Apart from fulfilling the deep wish of Rasul Allah (SAW), this naskh was also a test for the companions. Naskh cannot occur anymore because when the Prophet (SAW) completed his hajj the ayah was revealed that "This day, I have perfected your religion for you" [Surah Maidah].
Verse 107 continues, " Do you not know that to Allah alone belongs the kingdom of the heavens and the earth? And, you have none, other than Allah, to protect or help you." We are reminded Allah is All-Powerful. Questioning Him does not even make any sense. Then ayah number 108 goes on to say, "Or, do you rather want to ask your Prophet as Musa was asked earlier? And whoever takes to infidelity in exchanges of faith has certainly missed the straight path". This ayah could either be addressing the Bani Israelis- people of the same tribe that used to ask Musa (AS) questions now questions the Prophet (SAW) and Sahaabas about the laws of Shariah, or, it may be addressed towards Sahaabas themselves to refrain from asking excessive questions. This is advice for us as well. We should remember etiquettes of questioning, which briefly are:
i) Ask a question that needs an answer - we don't need to get theoretical about everything in Islam. It is pointless to ask "if I make wudhu will Coca-Cola will it count?" We are most likely not going to be in a situation where there is no water around us and only Coca-Cola. This is a random question that is more a form of entertainment than a valid situation.
ii) Don't ask questions that are pre-decided. If you ask someone you respect where you should live and give them choices of two neighborhoods, it is against adab to tell him that someone in your family doesn't want to live there if he gives you his answer. What was the point of asking if the person already knew the answer? One should have intention to act upon what they are asking.
iii) Ask the question from one source, don't "shop around" and choose the answer you want. This is why we should only follow one madhab or school of thought rather than take different points from each scholar - so that we don't end up following our nafs (desire).
iv) Ask at the appropriate time. For example, there is a lack of scholars during our time. If we ask them a question regarding an issue we have, we should realize that they are also answering many other questions, and not expect them to immediately answer our own questions.
We should always keep these etiquettes in mind. May Allah (SWT) give us the tawfiq to avoid excessive questioning, remember the adaab of questioning, and may He not make us from among those who are questioned on the Day of Judgement, ameen.