I’ve published four books now, and did the formatting on all of them. Through repetition, I’ve gotten the hang of it, and even started pre-formatting my drafts so I wouldn’t have to strip it and start over later. There are also some great guides out there, such as the Smashwords Style Guide. If you’re looking to format your own books, this is a great place to start. The basics are the same for everywhere, though some things, such as page breaks, will vary according to website.