Wild guessing and copying everything you find (YouBoob video tutorials, old reddit threads, LLMs and AI hallucinations included in this) will (as you have seen), only get you so far.
Some suggestions, based on my experience:
Go back to the basics. Read the ESPHome documentation carefully.
Your ESP8285 is a ESP8266 with onboard memory. The code for an ESP32 may or may not work, depending on what section you are using. The vendor documentation will tell you which is appropriate if necessary.
You appeared to have copied portions of the athom vendor sample yaml code into your code, and then inside your code, are copying it in again, verbatim, doubling up and possibly overwriting your customisation Use it as a template and modify to your use as necessary, compiling your code only. This would tend to indicate the section of the documentation about nesting yaml code is not clear in your mind yet.
Try hard coding your WiFi credentials if your !Secrets functionality is not working (and most importantly, blank it out when you post here). Check your spelling in the secrets file matches your yaml code, exactly, including spaces, underlines, and capitalisation. The best way to do that it to temporarily cut and paste the lines into your yaml code and then you can be sure they are identical side by side.
Configuring your ESP device on your router DHCP configuration to have a Static IP address can also help enormously with troubleshooting.
Use of debugging switches in your code can help enormously. VERY VERBOSE should be turned off after you have located any problems.
Adding a temporary Web Server to your code will enable you to see defined variables in real time. Use the Visit option in ESPHome to jump to it after you have solved your WiFi issues.
Using the inbuilt ESPHome editor may be less resources intensive than VSCODE, and the resulting logs more useful.
Plan what you want to achieve, and the work towards that goal. This is far more efficient than throwing things into a pot and seeing what works. At the end you will be satisfied you have achieved your goal and have the understanding to build on it and achieve greater things.
Post your full ESPHome compile log once you have turned on debugging for further hints. (Use </> formatting for forum readability please)