This script will check wait types and related information. It waits for a minute and then collects historical and instantaneous wait on the server. You can run this script and troubleshoot based on the results.
You can use this script for troubleshooting when you want to check wait in SQL Server.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery