There are many threads here about how to write content. You might want to start by searching and reading. Reading is a great tool in learning how to write. You see the styles and formats that other writers use and can pick and choose what will suit your own writing style from their different content strategies.
As far as keyword optimization. Keywords are a part of SEO, a topic we don't bother discussing here in content. If you have specific SEO questions you will need to post them in the Internet Marketing forum.
With that, I'll leave you to search and learn. If you have any specific questions about writing, feel free to post them in a new thread.