Validate date time range

Dear Community,

I am looking at Event DocType to do a simple resource booking.

I added a custom field called Resource.

How do I validate that this “resource” is booked (inside the db) between “starts_on” to “ends_on”?

Thanks!