You can connect a PS5 to a soundbar if the soundbar has an HDMI input and HDMI output/ARC port. According to Soundbar Mag the better way is to connect the PS5 to the HDMI input on the TV and the soundbar to the HDMI ARC/eARC