My Samsung 32ins smart television AF842TF only has a digital audio out optional socket there is no headphone jack and I also c

Solution
You need a DAC-headphone amp with optical audio input as well as an optical cable if you want to use wired headphones.
You need a bluetooth transmitter with optical audio input as well as an optical cable if you want to use bluetooth headphones.