... multivariate of how to do the job for sure. Engineers have many choices
https://www.mcmaster.com/standard-shaft-couplings

Do you have any wiring diagrams of your setup? may help Color code?