Can I safely delete photo library to save room
Don't do anything with the external hard drive yet, except eject it and unplug it, so you have a good backup in case anything goes wrong. That said, the following steps should do what you want.

First create a new library on your Mac's hard drive by holding Option while you open Photos, then clicking Create New.

In order to use this with iCloud Photo Library (ICL), you must designate the new library as the system photo library. Go to Photos menu > Preferences > General tab and click Use as System Photo Library. Next go to the iCloud tab and turn on iCloud Photo Library, then choose the Optimize Mac Storage option.

At this point it should start downloading thumbnails and some original files ("optimized" means it caches all thumbnails locally, then uses a certain amount of the space available on your hard drive for original files).

This answer is based on the Apple support article Designate a System Photo Library which states, at the bottom, that setting a new system library and turning on ICL will merge into (not overwrite) the existing ICL that Apple has stored on their servers. It's possible it might not, and in that case, you may not be able to do what you want.