How can I programm the controllers for Microsoft XBox and Sony Playstation 4?

Hello! I would have a question to you. How do I program the controllers for Microsoft XBox or Sony Playstation 4? So what I mean is when, for example, the control button on the controllers presses, you control the game figure to the right or left, forward or backward.
I would look forward to an answer and a solution.
Amin

The best way, in my opinion, is to pick up the asset Rewired. It’s especially nice if you’re supporting PC games, since it can automatically support just about any gamepad generically.

The default way to do input today in Unity blows. There’s a new Unity input system coming, but who knows when that will be out or how it will compare to Rewired.