Little residential hvac help please. Newer unit leaks water once a year.

That doesn't look like a P trap.
Looks more like elbows and I don't see a vent.
Pick up a pre made trap and see the difference.
(Hvac supply house should sell clear ones with a vent and built in brush to clean).
Check the slope of the line leaving the tray and then cut out the elbows and glue in the new P trap, maintaining the proper slope of at least 1/8" per foot.

View attachment 1716134227
Thanks a bunch. I did just think to myself, wonder if they make one that's just pre made instead of that conglomeration of elbows. It drains into a floor drain. Definitely no vent, but didn't know it needs one.

Was thinking of this little guy, but if it has to vent, then it won't work?

Charlotte Pipe 1/2 in. PVC Schedule 40 Condensate Running Bend Trap PVC027010600HD - The Home Depot