How to Get mail from Inbox and Inbox subfolders?

Hi I need to get mail from inbox and inbox subfolder then extracted email to Excel file.

Can you please suggest the best way?