Enable and Disable button based on database

I’m working on booking appointments
As you can see, I want the time buttons only choose-able when the time is available and not booked yet.

How does the dataset work in this situation? And what coding should I use in this page to disable the buttons when its not available in the dataset?

Try using wix-data API instead of dataset: wix-data - Velo API Reference - Wix.com

Can you explain more?