It took me years of cooking every day to get to a level where I'm confident in my cooking skills. It's a lot of trial and error. Look up a recipe that looks good, and try to follow it exactly. There's no eyeballing when you are learning. There's a reason those ingredients are added in that particular order and quantity.
I've come to a point where I can whip up a recipe and improvise some, but that's after years of following recipes, experimenting and eating a fair share of disappointing meals.
Learn the fundamentals. Binging With Babish on YouTube is an excellent show to learn with its Basics With Babish series.
Want to re-emphasize, cooking is a skill that's learned by repetition.
There are methods to help. Over cooking vs undercooking is because of guesswork. Remove that by buying an Instant Read thermometer. Over and under season? Taste as you go, add more seasoning if it needs it.
Also, make sure you find a consistently good recipe. Allrecipes is a crapshoot even though it's consistently a top Google search. Another poster mentioned Kenji Lopez who tests the crap out of his recipes. I'd also recommend Alton Brown having solid but accessible recipes. America's Test Kitchen/Cook's Illustrated and Bon Apetit for when you're getting more advanced. More beginner friendly stuff like Budget Bytes tends to be less flavorful, but typically simple enough and cheap enough you don't feel bad screwing up.
Basics with Babish is decent, at least the early episodes, for helping explain and visualize some of the basic skills.
But again, it's a skill that requires practice. I've been cooking consistently for years and I still can't spin up a recipe from memory or by feel. I mostly rely on trusted recipes and maybe do my own riff if I've done something similar before.
My experience was the complete opposite. Just relax and do whatever you want, the pan is your own little canvas. If something doesn't work out, oh well, you tried and learned from it.
I've come to a point where I can whip up a recipe and improvise some, but that's after years of following recipes, experimenting and eating a fair share of disappointing meals.
Learn the fundamentals. Binging With Babish on YouTube is an excellent show to learn with its Basics With Babish series.