In order to enter cheat console commands on Xbox and PlayStation 4 and 5. You need to enter the following buttons all at once in the pause menu.
Xbox One, Xbox One X Series X, and whatever other stupid names Microsoft uses for its consoles!
LB + RB + X + Y
PS4 and PS5
L1 + R1 + Square + Triangle
Nintendo Switch - am not sure you can use console commands on this system
When you have done it correctly a line will show where you can type in the code. After you enter the code hit the admin command button.
In order to get console commands to work, you may have to type in enablecheats first. After that, you should be good to enter in the commands easily. Not all the commands you will find listed for PC will work on the console. Be careful not to double-tap the admin command button, because it may cancel the command you just entered in.