For setting up your DNS records for usage with Google Workspace and Microsoft 365 we'd like to point you to their own knowledge base articles. This information is subject to change and by using their own articles you can make sure you use the latest version of their configuration
Google Workspace / G Suite
Google Workspace shows the steps for DNS settings when you add a new domain or create a new account. They also have knowledge base articles to help you set up your domain: https://support.google.com/a/answer/140034 and https://support.google.com/a/answer/48090
Microsoft 365 / Office 365
Microsoft 365 also gives you instructions on how to set up your domain while adding it to the service but they also have a knowledge base article telling you everything you need: https://docs.microsoft.com/en-us/microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider?view=o365-worldwide