There's a bunch of layers to it.
A) including the best documentation and code examples within your project and referencing them for the AI when needed
B) if you aren't a Git wizard, I find its best to checkpoint the project essentially between context windows, which can be pretty inconsistent. Archive the best project results and you'll likely come back to them later, if not just to recycle some small features.
C) Ultimately YMMV based on your own skillset and goals. What you want to accomplish within a prompt will be entirely dependent on the LLM's ability to continue making changes to the entire system. If your prompts are demanding too much- you'll likely get additional hallucinations or totally derail yourself.
Software is still a collection of working pieces, so you have to flesh out each piece. And each piece is a learning experience if you haven't already mastered it.
Patience and distracting yourself while it works is a good help.