Yup! Welcome to programming - bang your head against things that you can’t do until you can do them. Then work on doing them better. As lost as you may feel, the fact that you have something specific to work on puts you in a good place!
Generally speaking, when you’re asking questions of people in forums like this, if your question is broad (as yours is), people will point you to documentation, or to other examples. The usual advice is to be as specific as possible with your question. If you’re asking how to write a tree sort algorithm, but you’re actually not quite sure how to even write any algorithm, the solutions for writing a tree sort aren’t going to be very helpful (I’m not saying this is where you are, but it’s just an example).
When you’re starting out, it can be hard to be specific, because you don’t necessarily know what it is you’re really asking. It’s as if you’re asking how to get to Paris, and someone tells you “Oh, you just drive to the airport and get on a plane,” but you don’t know what an airport is, don’t know how to drive, and that “get on a plane” actually means “purchase a ticket for a plane that is flying to Paris.” Once you’ve actually figured out how to drive and how to get to the airport, you start asking questions in forums about what to do with the controls of a jumbo jet.
Being specific helps here too. Read this. Then read it again. It’s really useful advice. But the gist is, whenever you’re asking a question, tell us not just what you’re trying to do, but what you’ve tried and what errors or problems that you’re experiencing. If you say “I’m trying to get to Paris - I managed to figure out how to get in the car and get to an airport, but when I tried pulling the throttle of the plane, but the plane didn’t lift off the ground,” people will be able to say “Whoa - you don’t actually need to fly the plane yourself! Here’s a website where you can buy a ticket.”