Is your controller connected via a wired or wireless connection? Is your controller an official console controller or from a third-party? What system are you currently using, and what type of controller are you connecting?
Restarting the game and system might also help fix the controller detection issue. Alternatively try re-connecting the controller to your PC or Console with a different cable.
Steam users may also refer to the official Steam page for controller support:
https://help.steampowered.com/en/faqs/view/41C5-7D8C-1671-411E
PlayStation players should also refer to the official PlayStation page for Controller support:
https://www.playstation.com/en-gb/support/hardware/dualsense-controller-support/
Xbox Players should also refer to the official Xbox Page for Controller support:
https://support.xbox.com/en-US/help/hardware-network/controller/connect-a-wireless-controller
Nintendo Switch 2 Players should also refer to the official Nintendo Switch 2 Page for Controller support:
https://www.nintendo.com/au/support/articles/controller-pairing-on-nintendo-switch-2-faq/