O believers! Fasting is prescribed for you as it was prescribed for those before you so that you may learn Self-restraint.
Meaning:-
Self-restraint: one’s ability to control one’s own impulses, emotions, or desires.
Simplified Breakdown:-
O believers! Fasting is the same as it was for those before you to teach you self-control.