I have connected the soundbar to the sky Q box with an optical cable and DVD player to tv via hdmi. How do I now connect DVD

Unless you have a fancy soundbar with HDMI pass-thru, you will get (probably) stereo only, if the soundbar has additional RCA / AuxIn input.
If your DVD player has optical out, you can swap cables between the SkyQ box and the player.
If your DVD player has coax SPDIF out, there are converters which can make it optical.