First, to enter commands in XCOM 2, you need to enable the XCOM 2 console. If you haven't already, go here to for instructions on enabling the console.
Open the XCOM 2 console by pressing any of the following keys on your keyboard:
Close the console by pressing the Esc key.
Once the console is open, type a console command into the console and press Enter to activate it.
Some commands have required or optional arguments, which are additional numbers or words that are added to the end of the command.
An example would be additem [item ID] [amount]. This is the command syntax. It tells you what the command and its arguments are. The two arguments are item ID and amount. These should be replaced with the item ID of the item you want to add and the quantity you want to add. The brackets [ ] should be removed in the final command. For example, the command additem AlienAlloy 3 would add 3 Alien Alloys.
You can find a list of all XCOM 2 commands here: XCOM 2 Console Commands.