Writing effective software documentation for maintenance requires planning, consistency, clarity, and accuracy. When planning your documentation, define the scope, purpose, and audience. Decide what types of documents are needed, the level of detail and format they should have, and how they should be organized and updated. To ensure consistency throughout your documentation, use standard terminology, notation, and style that follows the conventions and best practices of your language, framework, or domain. Use tools and templates to automate the process. When writing the documentation, make sure it is clear and concise while explaining the what, why, and how of your system; avoid unnecessary or redundant information that could confuse or mislead readers. Use examples, diagrams, tables, or screenshots to illustrate your points. Finally, keep your documentation accurate and up to date with the code by regularly reviewing and revising it; use version control and documentation management systems to track and synchronize changes.