Hi,
As the question is very general one, I will try to answer in a very general way. You can:
- Use Run command functionality to execute for example PowerShell commands (windows) or terminal commands (linux) to get logs
- You can RDP or SSH to your VM to and use whatever is available as tools on the machines to list logs
- You can use Azure Monitor Log Analytics (additional charge) to collect and store logs in Log Analytics via agent and view them via Kusto query language.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.