Delete the iCloud photos on my laptop while keep them in iCloud

I want to delete the iCloud photos on my laptop, but I do not want to delete them from iCloud. I still need these photos. What are the steps?
Go to the iCloud settings on your laptop and then turn off iCloud Photo Library. Afterwards, go ahead and delete the pics from your laptop.

Original thread: https://forums.imore.com/threads/delete-the-icloud-photos-on-my-laptop-while-keep-them-in-icloud.349641/