John is writing because He does not want His children to sin. By knowing Him, abiding in Him, and understanding Him, we ought to walk as such.