Imām Ibn al-Qayyim (d. 751 AH) said:
Allāh never prevented His servants from something except that He has granted them in its stead that which is superior. Just as He forbade making decisions based on the drawing of lots but granted in its stead the invocation of istikhārah1. He has made usury forbidden, granting in its stead profitable trade. He has made gambling forbidden, granting in its stead beneficial, healthy competition whether it be in religious acts, or vying with one another on horses or camels, or in archery. He has made the wearing of silk forbidden [for men], granting in its stead several kinds of opulent fabrics like wool, linen, and cotton. He has made fornication and homosexuality forbidden, granting in its stead marriage with women of righteousness and beauty. He has made intoxicants forbidden, granting in its stead drinks of different varieties; all of which are delicious, granting continuous, beneficial vitality to both the body and soul. He has made listening to the instruments of idleness whether stringed instruments or oft-repeated rhyming verses forbidden, granting in its stead listening to the glorious Qurʾān and its seven oft-repeated verses [i.e., Sūrah al-Fātiḥah]. He has made the consumption of detestable foods forbidden, granting in its stead nutritious, nourishing food.
Whoever truly acknowledges, understands, and contemplates this will find ease in abandoning the following of his own contemptible, blameworthy desires. Instead opting to engage in its more beneficial, excellent replacements. Furthermore, he will be able to fully acknowledge Allāh’s wisdom, mercy, and the perfect completion of his blessings in relation to that which He has ordered, allowed and forbade. For He has ordered them with what He has ordered not out of His need for them, nor has He forbade that which He has forbidden out of stinginess or greed on His part from them. Rather, He has ordered them with what He has ordered as a way of treating them with goodness while showing mercy and compassion for them. Just as He has forbade that which He has forbidden as a means of protection and preservation for them.
 See Ṣalāt al-Istikhārah Explained by Shaykh Mūsá Richardson
Source: Rawḍah al-Muḥibīn: 17-18
Translated by: Riyāḍ al-Kanadī