Anyways is one of those words you hear in conversation all the time -- so often, if fact, that you may never question it. But any way you slice it, the word's grammatically incorrect...which doesn't mean you should always refrain from writing it. There are some things you ought to learn about writing with anyway, any way and anyways.
Writing Anyway/Any Way
Grammatically speaking, anyway is an adverb. This just means that, when applied, the word modifies the other words in the sentence. By definition, anyway means nevertheless or in any case. So I might say, well, I'm going to do it anyway, or anyway, I'm going to do it.
Any way, by contrast, means something different, though it's often confused with anyway like it's interchangeable. Any way is a combination of an adjective (any) and a noun (way). When used together as any way, it just means in any manner or by any method. Example: I'm going to finish this post any way I can; I'm going to do it any way possible. If you're confused about which one to use, just swap anyway or any way for another word or words that mean the same thing:
I'm going to do it in any case.
Nevertheless, I'm going to do it.
I'm going to finish this post in any manner possible.
Technically speaking, anyways isn't a real word -- it's an error. However, it's one of those words that's so commonly used, it's been accepted into the vernacular. It's a common expression, usually used by a speaker who is resuming a narrative: Anyways, back to the rules of good grammar...
Therefore, it's okay to use anyways in dialogue if it's the sort of word the speaker might use. In a casual conversation, the word crops up all the time. But you should refrain from using it in your standard narrative writing outside of dialogue, because by all rules of English it is incorrect.