Breakdown of Мой друг похвалил меня за то, что я не нарушаю режим сна, и я улыбнулся.
Questions & Answers about Мой друг похвалил меня за то, что я не нарушаю режим сна, и я улыбнулся.
Меня is the accusative (and also genitive) form of я. After похвалить (to praise), the person being praised is the direct object, so Russian uses the accusative:
- похвалил (кого?) меня
за то, что is a common pattern meaning for the fact that / because (specifically as a reason for praise/blame).
It introduces a subordinate clause (что…), and that subordinate clause is separated by a comma:
- за то, что я не нарушаю…
Also note the spacing: it’s за то, что (two words + comma) in this meaning.