Basically what Phil17108 said:
TV: inernal ATSC tuner -> optical out -> optical in of AVR for 5.1. That will work for all network programming that broadcasts in 5.1 and some Smart apps if they can decode 5.1. Not all tv's Smart apps can though. That's one of the reasons I'm not a big fan of Smart tv's. If you have cable and not OTA tv, you can connect the cable coax to the Cable/Ant input of the tv and use the internal ATSC tuner for your stations. There are other ways to connect as well but that's the easiest. Optical can only carry 5.1, it can not handle HD audio (lossless audio, DTS-MA, Dolby TrueHD, etc).
ARC (Audio Return Channel) is ok but it can be difficult at times. It's basically designed to eliminate the use of an optical cable but as pointed out above, it will not carry HD audio. I never use it.
A basic setup would be:
All devices (blu-ray playter, Roku, AppleTV, etc) connected via High Speed HDMI to the AVR's inputs. A single High Speed HMDI cable out from the AVR to the HDMI input of the tv. Optical out from the tv to the AVR input. Leave the tv's speakers off. You'll have to pick your source each time (device) unless you have a universal remote (such as a Harmony) that can automatically switch inputs (sources). So basically all audio, regardless of source, will be played thru the AVR and only video will be sent to your display device (tv). If the AVR can decode HD audio, then any blu-ray which has HD auido will be decoded and played. Any tv programming, because it is coming from the internal ATSC tuner, will play 5.1 if broadcast. Xboxes, PS3s, etc may require a slightly different setup but the basic idea is the same.
If you can avoid it, I'd stay away from using switches. There's nothing wrong with it but it's one more thing in the a/v chain that is best left out if you can setup without it.