PS5 and Xbox controls

Hello. I want to add console controls to a game, but I’m not so sure how. Should I loop through all the gui’s, make seperate scripts for console players and pc players, and if so, how?