Hadoop NameNode is said to be the centralized place of an HDFS file system. HDFS contains the directory tree-track of all files in the file system. In short, it holds the metadata related to datanodes.
When we format namenode(bin/hadoop namenode -format) it formats the meta-data related to data-nodes. By doing that, all the information on the datanodes are lost and the datanodes becomes reusable for new data.
For more information regarding Hadoop, refer the following link: