How should I talk to professor if I have been absent from project for weeks due to mental health issues?
Update your professor about why progress has not been made and what your next steps are. If you need more time to focus on your mental health, then let your professor know.
One other important thing we should make clear: you are doing this work on your own time, as opposed to being paid. Research mentors or professors with unpaid research assistants should be grateful for any time you can devote to the project assuming you do not take their time for granted. It appears thus far that your professor has not invested a lot of time into the project with you, so you are fine. We should also note that you have no contractual obligation to do the work.