Step1=>First run the MerkleTree.js file it will provide you the input as shown in the image1 Now you have Merkle Root Hash and Merkle Proof Not Go to the remix and pass the merkle root hash in the field as show in image2 Now deploy the contract and go to the safeMint function and pass the merkle proof that we have generated earlier in step 1 Make sure you are calling the mint function from the same address , for which you have genreate the merkle proof. so it will mint the NFT on your address. and mapping in the contract is set to true to make sure that you have mint/claim the NFT.
explaination of MerkleTree.js File print the merkle root see line 17 and 18 , we are appending 0x with this At line number 21 we are passing first address to keccak256 algo to genrate hash and the in line 22 we are getting proof of this hashed address with the help of tree.getHeProof function.
Note: For every address merkle proof will be different you have to genrate the merkle proof separately for each address if you have any question you can ask in comment section.