If your intention is coding something complex, you should try a model finetuned for that, i don't think llama 3 is that good for coding. But i used standart prompt engineering stuff, same as from llama 2. Instead of chat, you use a completion mode, where you just need to give it a text to continue writing from.
I personally don't use LLMs to code, besides a few snippets or when i'm out of ideas what/how do to. But models like Starcoder and Code Llama is what i see people often using for this purpose. There are benchmarks for various languages, you can find those on Hugging Face.