Here’s a few posts to check out. There is logic to prevent double booking.
I also have a Booking demo which is a bit simpler than the other 2 examples above. Mine is largely inspired by @Robert_Petitto.