Chapo, welcome to ribnet!
I've not done the HDSm but I guess Lowrance kit will be similar.
There are two (three) data connections on the unit - a Loewarancenet thing (probably yellow connectoron the back); NMEA2000 (red connector) and NMEA0183 (probably a set of 4 wire tails from the big blue "everything else" connector.
It;s those 4 wires you need to go for.
I guess if you have had the radio fed from another GPS, you need to connect the "in" wire (as you used before) to the "NMEA0183 out" wire on the HDS. (I'm not going to guess at the colour from here!) Be aware that if the HDS is like the old one I have, you may need to dive into a set-up menu to tuern on the 0183 data.......
The AIS unit I am also guessing here, but if it doesn't have a similar looking connector to the Red one on the back of the plotter, you'll want to find the "0183 in" wire & connect the AIS output to that.
All -ve "data returns" will likely be through the -ve power cable.
Needles to say if you have NMEA connectors on the radio & / or AIS, post back, as the wiring becomes so much easier!
Sorry it;s abit of a guess, but if you think through the above with your Plotter manual to hand hopefully it will become clear - if not post back & I'll go pull the manuals so I can make it clearer & remove the guesswork!