You need to import the photos from the folders in iCloud Drive to the Photos.app as tygb explained. But the photos have to be downloaded to your Mac before you can import them. Click the download links in the cloud icon to the right of the photos to download them. or drag them to your Pictures folder (any folder that is local on your Mac and not syncing with iCloud Drive), then you can drag them to the Photos icon in the Dock to import them to Photos.
I want to optimise storage on my MacBook so do not want to download the original files to it.
Try to do it in small groups, not all at once, so you not exhaust your local storage. Once a folder with some photos hasbeen imported to Photos and you checked it, that they now appear in Photos at www.icloud.com, you can delete the photos you just imported to Photos from their original folder. It is not possible to move photos between iCloud Drive and the iCloud Photos Library. Import the photos to Photos, check, if they really have been imported and can be opened in Photos, then delete them from their original folder in iCloud.
Or copy the photos you are now having on iCloud Drive to an external drive. Then import the photos from this external drive to Photos. The external drive can double as a backup of your Photos; you will need a separate backup anyway, if you are using iCloud Photos, because the "Optimize Storage" option will prevent Time Machine from including the photos into your regular Time machine backups.