Technical term: أَنْ + فعل مضارع is called Masdar Muawwal.
In أَمَرْتُهُ أَنْ يَذْهَبَ, the complete part أَنْ يَذْهَبَ means “to go” or “his going.”
Recognition method:
● Find أَنْ.
● Include the imperfect verb that follows it.
● Treat both words together as one verbal-noun expression.