So before you can really get into the library thing, you need to do a good C++ course. There are numerous online tutorials that you can walk through. You have to understand that they’re mainly written for PCs and not Arduinos so they’ll use cout and cin and a bunch of << and >> instead of Serial.print and Serial.read. There are a few other differences. But the main points about variable creation, scope, blocks, flow, classes, structs, and all that stuff will all be the same.
You really have to know that sort of basic C++ stuff to get very advanced with Arduino. You hit a point where just changing random things stops working and you can never get any better. But C++ isn’t that hard if you’ll just start from the beginning and take a few days to go through one of those tutorials start to finish. OR at least up until you get to classes and structs. Maybe look at inheritance but you don’t have to really learn it. But the basics of classes and struct will be CRUCIAL to working with writing your own libraries.
Here’s one that I went through with someone once and liked. C++ Language - C++ Tutorials It’s by no means the only one or the best. But you can start at the first link under introduction and just keep reading until you get it and go to the next page.
The key to learning this stuff is that you can’t jump into the middle. You gotta really get the basics down to have any hope of understanding the later stuff.