Simple explanation
AI models are trained to be helpful. So when you ask them to change one thing, they "helpfully" rewrite the surrounding code to make everything neat and consistent. In doing so they quietly break things you never asked them to touch. This is the most common beginner mistake — and it is not your fault.
What to do
Add this sentence to the end of every single prompt: "Only change what I specifically asked. Do not modify anything else." That one sentence tells the AI to stay in its lane. Bonus: also add "Show me only the exact lines you changed" — so you can see precisely what it did before you accept it.
Copy-paste prompt
[Your specific task here.] Only change what I specifically asked. Do not modify anything else. Show me only the exact lines you changed.
Course note
Key takeaway
End every prompt with: "Only change what I specifically asked. Do not modify anything else."