I am planning to write couple of free ebooks for the benefit of the community. Can anyone please suggest me a good tool for smashwords compatibility?
The short answer is to use any tool which produces a valid epub file.
There are 2 options.
Create it in MS word and use Smashword's meatgrinder tool to convert it to epub.
Or create the epub file yourself and submit it directly.
If you are more comfortable with MS Word and don't mind troubleshooting its strangeness, go ahead with that. But MS Word is a complex beast.
I would recommend trying to learn to create the epub file yourself. But the process is not that easy.
One option is to rent Adobe Indesign and pay for one month. That should be enough to create your book and export it into epub. This is overkill.
Sigil is a somewhat user-friendly tool for creating epub files. It requires knowing html.
One thing you can look into is the online pressbooks for generating ebooks. It's free and works moderately well.
There are now more commercial tools for producing ebooks. All have their limits or might cost money. But they might be fine for generating ebooks.
All the solutions are somewhat bad. They are useful for producing simple ebooks -- without much formatting.
Before you submit it, you should validate the epub file with the online validator. Smashwords won't accept a file which doesn't validate.
Two other things to keep in mind: 1)try not to use creation tools offered by the book distributor. They tend to be specific to their devices. 2)you may have to format something entirely different to make it work in kindle. However, if your epub file generally passes the epub validator, then you can use Amazon's kindle converter to make it.
Here is a link to the Smashwords style guide: