Knowing that you shouldn't talk to cops isn't the same as knowing how to not talk to them, particularly because you often have to say something, and there are things you should say. What people really should be taught is where to draw the line.
That line starts with who is asking the questions. Depending on your state, you might have to identify yourself if they ask. But just about every other question should be refused, or better yet, ignored. Instead ask your own questions, starting with whether they are detaining you. That forces their hand and gives you the option to either walk away or invoke your right to silence and ask for a lawyer.
And don't forget this applies to witnesses, reporters and even victims. If you decide you have to, should, or want to tell them something, say only the bare minimum necessary. Be careful and don't assume they're on your side just because you're not the suspect.