Depending on your country HR is actually your friend and the company is required by law to protect you against physical and mental issues caused by work (and especially not allowed to fire you for them).
Even non workplace related issues can be handled very well by being open to HR and your boss.
I am from the Netherlands, I have manic depressions and have recently started to deal with short burn out periods.
On my first job (150-200 employees internationally) I lied about my situation for about half a year.
I allowed myself 0 rest and had to come clean to HR when I finally collapsed for two weeks.
Instead of being fired I was sent to the company doctor and we made a plan so I could get back to work, slowly building up my working hours again (while still being paid in full).
I kept communication with HR very open after that and always got the one or two days of rest when I needed it.
At my second and third (current) jobs (+/- 15 employees, no HR) I was open about my situation from the start.
This allowed me to get in a position where I can be open about my situation with everyone and reach a deal where my contract has about 20 hours and I can work up to 40 hours if I'm able (profit for both parties).
I can and do talk with my boss regularly about private issues and don't have the added fear of racking up to many sick days to cause an investigation.
If you ask me keeping your mouth shut to your boss and/or HR is the worst thing you can do.
Note:
This answer is based on my personal experience and understanding of local laws and may not work for you AT ALL.
On my second job I was understandably given the label 'high risk factor' and my contract was not extended after two years.
Part of my success is because I understand the risk I pose and try to decrease that factor for my employer with a non standard contract.