Programming is mostly understanding something abstract in your mind not rote memorization.
Even for a very simple program, focus on understanding what it does and how it does it, and why, step by step. Write things down when you learn something new.
Reading and understanding code, especially good code, will make you a good programmer. Just writing a ton of shit code will not. Trust me, I've done this for 3 decades and learn something new almost every day from reading other people's code.
So, focus on understanding what it does, and you will be able to modify and build programs from scratch soon.