There are multiple ways to download a file from the s3 bucket. You can use aws cli command in your script. Or you can use the boto module. The Boto module will connect to AWS API internally. you can take help from the below script.
BUCKET_NAME = 'my-bucket' # replace with your bucket name
KEY = 'my_image_in_s3.jpg' # replace with your object key
s3 = boto3.resource('s3')
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404":
print("The object does not exist.")