How to play animation from code

The Animation Blueprints use States and Transitions, yo change betwen states just change the conditions in C++ to change the state, for example, if you have two states Idle and Aim, and the transition is “IsAiming”, just change the boolean IsAiming in C++ and be sure that is changing too in the Animation Blueprint (in the Event Graph)