If you say to an actor following a performance that you don't know how they learn their lines, it isn't usually taken as a compliment; if the best thing you can think to say is about such a mundane, run-of-the-mill part of the actor's job, it suggests perhaps you weren't exactly gripped by the performance—although I have seen performances where the amount or complexity of the lines make remembering them an impressive feat in itself (long solo shows, most Beckett).
However, remembering lines is an essential skill for an actor and one which, to my knowledge, is rarely taught—actors are just expected to find their own way to do it—but 'drying' is an anxiety for most actors, particularly those taking their first steps on stage and even experienced actors as they get older. Mark Channon's book, in the Nick Hern series of Compact Guides, attempts to address this by coming at the issue from a number of different directions.
Channon was an actor who performed at the National Theatre and in the West End, but he also became one of the first Grand Masters of Memory at the World Memory Championships in 1995. His other books are solely about memory rather than theatre or acting, and his own web site is mostly focussed on selling a monthly subscription app "aimed at helping you design and track simple habits that make big changes in your life."
One of the main memory techniques described in this book is the 'memory palace', which goes back as far as Ancient Greece and Rome and is used by many memory champions to memorise lists of items by imagining them placed in specific spots around a familiar location (obviously I'm simplifying greatly). I would have thought that dialogue was more complicated than the usual uses of this technique, but Channon shows examples of how he would apply it firstly to a list of quotations and then to sections of dialogue from the plays Lemons Lemons Lemons Lemons Lemons by Sam Steiner and Among Unbroken Hearts by Henry Adam.
As well as pure memory techniques, Channon looks at things that prevent us from memorising effectively, such as lack of focus, wandering attention and anxiety about not being able to learn the lines. He describes techniques for concentration, mindfulness and relieving stress, and also looks at when and how quickly to learn the lines, advocating a slower approach that starts with the story and the character's intentions before worrying about getting the words exactly as printed in the script.
All of these techniques need to be practised thoroughly and with commitment for them to be effective, which I didn't do when reading it to write this review, but there is plenty in this small and reasonably priced book for any actor to try out if they want to improve their speed of and confidence in learning lines for rehearsal, the film set or a last-minute audition or self-tape.