know inside out
The Spanish phrase 'saber al dedillo' translates to 'to know like the back of one's hand' in English. This means to be very familiar or knowledgeable about something, so much so that one could explain or navigate this thing competently and effortlessly.
She knows how to solve this problem by heart.
This phrase implies that she has thoroughly learned the method to solve the problem and can do it without needing to refer to resources.
The teacher knows the history of literature by heart.
Here, it indicates that the teacher has a deep understanding and memorization of literature history, showing expertise in the subject.
Juan knows the rules of the game by heart.
This suggests that Juan has mastered the game's rules and can recall them perfectly whenever needed.