Seems simple enough:
1) Select the OUT records;
2) Select the closest IN record for the same employee;
3) Calculate the difference.
SELECT
O.EmployeeId,
I.AttendanceDateTime As TimeIn,
O.AttendanceDateTime As TimeOut,
DateDiff(minute, I.AttendanceDateTime, O.AttendanceDateTime) / 60. As HoursWorked
FROM
YourTable As O
CROSS APPLY
(
SELECT TOP 1 AttendanceDateTime
FROM YourTable As I
WHERE I.EmployeeId = O.EmployeeId
And I.AttendanceDateTime <= O.AttendanceDateTime
And I.PunchMethod = 'IN'
) As I
WHERE
O.PunchMethod = 'OUT'
;
For your sample data, this produces:
| EmployeeId | TimeIn | TimeOut | HoursWorked |
|------------|---------------------|---------------------|-------------|
| 439D | 2022-06-02 10:00:23 | 2022-06-03 01:32:10 | 15.533333 |
| 439D | 2022-06-04 02:06:39 | 2022-06-04 13:58:34 | 11.866666 |
| 439D | 2022-06-04 02:06:39 | 2022-06-04 02:06:39 | 0.000000 |
| 439D | 2022-06-05 10:17:43 | 2022-06-05 10:17:43 | 0.000000 |
| 439D | 2022-06-05 13:02:01 | 2022-06-05 19:31:51 | 6.483333 |
| 439D | 2022-06-05 13:02:01 | 2022-06-05 18:17:22 | 5.250000 |
| 439D | 2022-06-05 00:30:14 | 2022-06-05 00:30:14 | 0.000000 |
| 439D | 2022-06-05 13:02:01 | 2022-06-05 13:57:21 | 0.916666 |