Bloqueando agenda

Hey guys
I’m creating an app for schedules.
I don’t want already scheduled times to be booked.
I can’t lock the schedule.
How can I do it.