The CD-drive slot can normally (at least for Core-i CPU systems) be used for any type of SATA harddrive. There exist special trays into which you can screw or click the harddisk or SSD and which fit into that slot in stead of the regular CD.
These trays are sometimes very much specific to the model of laptop, so you best order one from HP for this particular laptop. That way you can be guaranteed that it will fit properly.
The CD drive bay is in some cases not bootable. If that is the case the solution is simply to put the classic harddisk in the tray and put the SSD in the normal harddisk slot.
Please note: Many modern laptops have an internal M.2 slot into which a M.2 SSD can be fitted. (Some even have 2 of these slots).
If that is the case it is better to use that. Performance will be as good, or even better (M.2 slots are SATA3 or better and the CD tray could be limited to just SATA2) and you get to keep the CD in place as well.