how can i connect sony receiver(str-de475) to my ps4 or samsung smart tv?

Solution
unfortunately that model is old and has limited inputs (stereo rca, optical, coax). not sure if the optical and/or coax allows for 5.1 on that set or not (you will want to check as not all models do).

you will also want to note what outputs your tv has.

your ps4 would be best via optical since it has this connection on it already. if you intended to use optical from your tv then instead you could get something like an audio extractor with coax or a spdif to coax adapter.

the tv would be best via optical or coax if it has those.

^if you expect 5.1 you will want to make sure that both the receiver supports it and that your tv supports it over coax or optical. otherwise, it would be stereo only.
unfortunately that model is old and has limited inputs (stereo rca, optical, coax). not sure if the optical and/or coax allows for 5.1 on that set or not (you will want to check as not all models do).

you will also want to note what outputs your tv has.

your ps4 would be best via optical since it has this connection on it already. if you intended to use optical from your tv then instead you could get something like an audio extractor with coax or a spdif to coax adapter.

the tv would be best via optical or coax if it has those.

^if you expect 5.1 you will want to make sure that both the receiver supports it and that your tv supports it over coax or optical. otherwise, it would be stereo only.
 
Solution
Your receiver has an optical digital audio input which is the most common type of audio output found on TVs so you just need the cable. You will need to select that input and may have to change the audio output type on the TV audio menu. You can try different surround modes on the receiver.