How do you learn coding efficiently? I just don't know how to write code for my HTML/CSS project (details below)

I have finished everything for the survey form project, and I can now clearly remember the HTML tags, the CSS code, etc… but when I get to write down the code, I just get… really confused? Like, I know what those tasks meant, but I just couldn’t arrange them in a good way.

For example: the 11th task (which is: " For the name, email, and number input fields, you can see placeholder text that gives a description or instructions for each field"), I know that I can use:

<input type="text" placeholder="Write your name down here" name="realname" id="name-label" required/>
<input type="email" placeholder="Write your email here" name="email" id="email-label" required />
<input type="text" placeholder="Write your number here" name="number" id="number-label" pattern="0-9" required />

I know the code I can use in order to complete the task, but the problem is: where do I put it? When I was learning via the tutorials before, they wrote every single line of code for me already, so all I have to do was just to remember a HTML/CSS tag/code they were asking me to use, then write down that + any needed components, so when they took away all of that in the project, I have 0 clue on how to solve the problem.

This is also a continuation of my previous post. I’m thinking that I should just copy those code I’ve written down in the previous exercises, or from someone else’s. Should I do this?