w-2 and 1042-S / Tax return for the last year of residency in the US

Hi, I'm a foreign national that lived and worked in the US until late June 2023. 

I moved back to my home country, and have started working on a contract basis as a freelancer, working remotely.

I visited the US for a month in Nov-Dec so per the presence test, I believe I am considered resident alien for 2023 and need to file 1040.  

I have already entered information of my W-2 from my employer up until I moved out of the US, but couldn't figure out how to enter the information from 1042-S which I received from one of my clients in the US that I work for remotely as a contractor.  I was also wondering if I should / need to claim deductions on expenses related with the the work? (I have already paid taxes to Japan for the freelance work.)

Thank you!