It’s a matter of trial and error until you come up with an optimal statement of work. Don’t waste time on reinventing the wheel – start with a good template and build on that until you find out what works for you.
Make sure your statement serves its purpose. It should define, align, and document the project’s expectations. Simply put, it’s the single source of truth when you’re wondering whether something is in scope or out of scope. And to be effective it has to be easily accessible and clear to all the stakeholders.