How to check the particular folder exists in sharepoint by using Microsoft 365 scope

here you need to use for each file or folder to get the folders info as @ashokkarale suggested.
Give a try on both, from which option you are able to get the folder info.
if didn’t work both try other options also