You should report $1,038 as your excess 401(K) deferral as wages on your 2018 Tax Return.
You can report the $40 loss from your corrective distribution as a negative amount on Line 21 of Schedule 3 on your Form 1040. You should identify it as “Loss on Excess Deferral Distribution.” This loss should be taken in the year that you received the corrective distribution. So if you didn't receive the refund until 2019, you will report it on next year's return.