I greatly struggled too, I didn't get it. For a long time, programming was very hard. But eventually I understood, and then was challenged again with new concepts. This keeps on happening and I continually learn and am challenged, but reading your post doesn't make me think you aren't a hard worker.
I think you are struggling with learning a language instead of learning how to think logically. Instead of learning a language, learn how to break up a complex requirement into discrete steps. An example --
I ask you to save inputted text into a text file called "file.txt". What are the steps you need to take (to write this in any language?) This comes with experience but I'll walk through it here:
1. Take in input from the user.
2. Write out input into file.
I don't know everything, so when I forget, I google this stuff. "How to take in input in C++". Okay, I understand what I need to code. Next, how to write a file "how to write a file in C++". Done. By combining these steps, I've accomplished my goal.
Basically, my whole experience has been following this pattern of taking a problem, breaking down it into individual parts, coding these individual parts, and coming up with the solution. However, with each step, you get into deeper detail. How do you take in input in C++? Well that's with cin, what's cin? Google C++ cin, ah okay. etc. As you program more, you start to memorize these steps, which lets you code faster and better quality. Instead of googling things, you remember that you have 2 steps you need to do to write out a file. Of course, working in different languages is basically the same, just different syntax for the same thing. I'd focus less on different languages and just one for the time being.
Take a read on a post I wrote up, I hope it's helpful: https://debugandrelease.blogspot.com/2018/12/how-to-become-b...