What are the best practices for implementing security at each stage of software development?

When building software with security in mind, what are the best practices for integrating it into each stage of the development process—from design, coding, and testing to deployment? How do you ensure continuous security testing and address vulnerabilities proactively? Any tools or methodologies you recommend to streamline this process?