How can I steal an object from an ia character?

Hi! Sorry because I’m just starting at this. I want my player to steal a card from a guard. The guard is still and the character must get him from behind and at a certain distance, press a button and get from him a card and add it to the inventory.

I know how to add the object to the inventory but not in the case that the payer has to get closer to the IA without noticing.