Know that the first rule of Tafsir is that the Qur’an explains the Qur’an. In other words, you cannot take an ayah by itself and think you understand its meaning; you have to hold that ayah up against all of the other ayaat, not only other ayaat which pertain to the same subject, but ALL the other ayaat. Because the Qur;an contains no contradictions, nether contradictory rulings, nor contradictions between rulings and moral and ethical principles which the whole of the Book affirms.
The context of an ayah is not only found in the Surah in which it is placed, and not only found in the occasion for its revelation; the context of an ayah is the Qur’an and Sunnah in their entirety.