I am having an EBS volume of 50 GB and I want to decrease it to 20 GB. The OS is centos 7 and has XFS file system. I have followed this link but it is more specific to ext4 and Ubuntu, can someone tell me how to proceed for XFS file system type
You may be able to change the XFS file system size, but you cannot decrease the size of an EBS volume.
You will need to create a new EBS volume, attach it to your instance, create a file system on the new EBS volume and then copy (migrate) the files from the old EBS volume to the new EBS volume.