I need a formula to calculate between two date and time excluding lunch time, holidays, weekend and between 09:00 and 18:00 work hours.
For example, 25/07/2022 12:00 and 29/07/2022 10:00 and answer has to be 1 day, 06:00
Thanks in advance.
I had a formula but it didn't work when hours bigger than 24 hours.

I don't know how you got to 1 day and 6 hours, but here is a customizable way to filter your time difference calculation:
Limitation
This solution only works on an hourly level, i.e. the start and end dates and times will only be considered on a full hour basis. When providing times like 12:45 as input, the 15 minute increment won't be accounted for.
Explanation
The 4th item in the LET() function
SEQUENCE(INT(end)-INT(start)+1,24,INT(start),TIME(1,0,0))creates an array that contains all hours within the start and end date of the range:then, based on that array, the different 'crit_n' statements are the individual criteria you mentioned. For example,
crit_1,array>=startmeans that only the dates and times after the start date and time will be counted, orcrit_6,HOUR(array)<>13is the lunch break (assuming the 13th hour is lunch time), ...All of the individual crit_n's are then arrays of the same size containing TRUE and FALSE elements.
At the end of the LET() function, by multiplying all the individual crit_n arrays, the product returns a single array that will then only contain those hours where all individual criteria statements are TRUE:
So then the SUM() function is simply returning the total number of hours that fit all criteria.
Example
I assumed lunch hour to be hour 13, and I assumed the 28th to be a holiday within the given range. With those assumptions and the other criteria you already specified above, I'm getting the following result:
Which looks like this when going into the formula bar: