learn by heart
/lɜːrn baɪ hɑːrt/
VD : I have to learn by heart the lesson before going to class.