He warned them not to get near a certain tree, otherwise everything else is permitted. (some people wrongly say it was an apple tree but there is nothing in the Quran that suggests it was an apple tree.)
We cautioned, “O Adam! Live with your wife in Paradise and eat as freely as you please, but do not approach this tree, or else you will be wrongdoers.” Al-Baqara 2: 35
لقد أمرهم الله أن لا يقربوا شجرة واحدة. و المتعارف عند الناس أنها شجرة تفاح و هذا خطأ. إذ القرآن لم يذكر ما هي الشجرة.
وَقُلْنَا يَا آدَمُ اسْكُنْ أَنتَ وَزَوْجُكَ الْجَنَّةَ وَكُلَا مِنْهَا رَغَدًا حَيْثُ شِئْتُمَا وَلَا تَقْرَبَا هَـٰذِهِ الشَّجَرَةَ فَتَكُونَا مِنَ الظَّالِمِينَ )َ
البقرة 2: 35