How to convert a CD player's coax diigital output to a Toslink?
Check inside the CD player, follow the SPDIF output trace and probe around. Most likely you will find the SPDIF output comes from the big CD decoding chip, it will probably be 3.3V in level, and go through a 75R resistor and maybe a capacitor and some other resistors.

Find the point before the resistors and caps where you have a nice logic level waveform, this is what your TOSLINK transmitter wants as an input.

Check if your TOSLINK transmitter uses 5V or 3V3 (for example measure its power supply on the board you took it from).

If voltages are compatible, you can install the TOSLINK transmitter inside the CDP (drill the back side to make a hole) with a bit of perfboard on which you'll put the decoupling caps, maybe a voltage regulator to supply it. Connect its input to the SPDIF signal with a short wire which should be taped against the PCB ground plane, it's a bit "ghetto" but signal integrity should be decent.