Sorry to make you memorize this random string of digits. If it helps, it can also double as a mnemonic for remembering your young relatives' birthdays, if they happened to have been born on February 5th, 2018.
Cueball and Megan are on vacation or otherwise traveling, and receive a code for their hotel room. Megan gives a seemingly nonsensical and unhelpful mnemonic by which Cueball can remember it... which, inexplicably, actually helps Cueball to remember the code. Cueball becomes VERY angry on realizing this.
The first three prime numbers are actually 2, 3, and 5. So this technique easily identifies the first two digits "02". "05" is slightly wrong because it's not the second prime number; it's the third. And "18" is even more wrong because it's not actually a prime number; it's 2 × 32.
So the mnemonic itself doesn't really provide the method for remembering the code. Instead, figuring out how to apply the bogus mnemonic will reinforce your memory of the code. Unless you actually happen to be really bad at prime numbers and panicked while remembering them, in which case the bad mnemonic actually... helps?! Why is your memory like this?!
The title text points out that the code is also similar to a date in the (potentially ambiguous) MMDDYY format - not an unexpected choice, seeing as Randall lives in the United States - so if you happen to have a relative who was born on February 5th 2018, the memorized code will help you remember this date if using said date format. It is also a valid date in the DDMMYY format but in that case it would be the 2nd of May 2018, or in YYMMDD format, in which case it refers to 18th of May 2002.