Hello welcome to the forums , hope it helps and supports you on your journey
I want to start off with bringing up a distinction, HTML and CSS are not programming languages. Consider HTML as as an extension for words, in that you markup your words to describe it better (to a browser). CSS is used to describe how things look, so its in a similar boat. You can consider both as just syntax, where memorizing how the syntax works is more or less all you have to do.
The best way to “learn” is to practice. If you read about how to do X, you wont 100% remember this forever unless you use it a number of times, and learn about how it can be used in a number of cases. The easiest way to gain this experience is to go out and build stuff. This goes for learning basically anything. The more you practice, the more knowledge gets transferred to “muscle memory”.
For syntax and API problems, looking at a reference usually helps you get over the “what does that do?”. When you need help on doing X, being able to get answers usually relies just on straight google-fu, AKA phrasing your question correctly to get the most relevant answers.
One of the best references out there for web development is MDN it has tons of resources on web apis, references, tutorials, guides, and everything in between. For higher-level overviews FreeCodeCamp guides is another good one for situations where you go “what is that technology” or similar.
Good luck, keep building, and don’t worry if you forget stuff or need help, its all part of the learning experience