Store wait_stats automatically and query it whenever required
You could get a monitoring tool like Idera SQL Diagnostic Manager or Dell Spotlight to do all of that for you. If you want to go the manual route and get the wait stats yourself you can check out sp_BlitzFirst from Brent Ozar. You can use that to store wait stats in a table. If you click through the link they give you directions on how to set it up to log to a table.