The Lazy Writer in SQL server is a background thread which manages allocation and deallocation of memory pages in the memory.
It is key component of memory management subsystem of SQL Server.
It continuously runs & searches the buffer pool & try to find those pages which are least recently used (LRU).
The main & important role of Lazy Writer is to provide sufficient memory to the database to perform its operations efficiently.
An algorithm named as Least Recently Used (LRU) is used by Lazy Writer to decide which pages to evict from buffer pool. It tracks the timestamp of last access of each page. The pages with the oldest timestamp are considered as least recently used and are ready for eviction.