What are the best practices for managing employee attendance in hybrid work models?

When employees work partly from home and partly from the office, what are the best ways for companies to track and manage their working time?