API call to Dynamics 365 CRM

Hi,

I have the Client ID, Client Secret of the Dynamics 365. I want to get the Access Token and with that token, I need to access the CRM entities. Anyone has the code to achieve this?

Thanks and Regards