hdfs is in critical in stage due to bad health space is not more than 20 gb than how to handle this
What do you mean by bad health space here? Is HDFS Full and getting critical alerts either in Ambari or Cloudera Manager? Are you able to read and write on HDFS? Please can you elaborate as well it will be more helpful if you attach some screenshot to understand the issue?
Try to clean up some old files from your disk or else add some more space into the disk.
Adding to Jagadeesan comment.
You can run disk balancer command to balance the disk space across your cluster.
If you are using a multinode hadoop cluster you can follow link - https://hadoop.apache.org/docs/r3.0.0/hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html
or if it is a single node cluster or to balance disk load with in a single data node use the following link - https://blog.cloudera.com/how-to-use-the-new-hdfs-intra-datanode-disk-balancer-in-apache-hadoop/