Which version of SharePoint are you using?
1. If you are using on-premise then you can achieve this using 3 lists and a workflow (oob and recommended) or using custom scripting.
2. If you are using SharePoint Online, then you can achieve this by modifying list form using powerapps or you can create a flow similar to the workflow.
Create 3 lists.
1. Public Holidays (Title, Date)
2. Leave Balance (Person, LeaveBalanceCount)
3. Leave Calendar (Title, Start Date, End Date, Reason)
Steps of Workflow or flow:
1. Start on Item creation
2. Declare variables HolidayCount and dayCount = end date - start date
3. Loop from 0 to dayCount and check if ever date is present in public holidays list
4. If not then increment HolidayCount by 1
5. Once loop completed, HolidayCount is the count of days without public holidays
6. Update the applied users LeaveBalanceCount in Leave Balance list by subtracting HolidayCount from existing value.
7. Any other logic of yours
8. Completion of workflow
Please mark as answer if you got your outcome.
Thanks