Hi@akhtar,
To change the state of an EC2 instance you have to target it using the EC2 instance id, bypassing the id to the 'Instance()' method and then using the 'stop()' method to stop the EC2 instance.
import boto3
ec2 = boto3.resource('ec2')
ec2.Instance('instance_ID').stop()