Thank you for that reply.
Your answer is initially all I was looking for, the code actually does what I planned for it to do but I guess its not all there correctly as I would like so I got a lot of revisions to do.
I guess a specific question could be, what is the best development environment for developing and testing if this plugin works as I am trying to learn php, I have the developers handbook which is okay but I suck at learning from reading as somethings dont make sense and then i get really confused.
I Have VS Code, I have localhost WordPress, I use ChatGPT as a nice source to ask questions to for more indepth explanations when i get stuck but its all getting a bit overwhelming atm. A massive step up from html code in my eyes.