Is RCA Better Than Optical?

What is better RCA or optical?

.

Is Optical better than analog?

Do RCA cables affect sound quality?

What is the best connection for a soundbar?