Hi cindafromapo,
We see that you're inquiring about your photos in iCloud, if you were to remove your external drive.
Check out more information about moving your Photos Library to a storage device in this article: Move your Photos library to save space on your Mac. As quoted from there, "Always make sure that your storage device is turned on and available before opening Photos. If Photos can't find the device, it stops using the Photos library stored there."
In other words, you can disconnect the drive if needed, and as long as you don't open Photos, it shouldn’t change the System Photo Library which is your external drive. If you did happen to open Photos while it was disconnected, you would need to re-designate the System Photo Library all over again. And as for iCloud, if the external drive is disconnected, it would just attempt to sync into the internal drive instead of the external drive. It's best to keep your external drive connected and available if you're going to move your Photos Library to it.
You shouldn't experience data loss, but we do always recommend to create a backup before making any changes anywhere: Archive or make copies of the information you store in iCloud
Have a great day!