I feel really bad that I accidentally broke my friends phone
Oh no, I would feel bad too. But you did it by accident though, so that is okay I think?
No but I still feel bad about it because I never told him I did it.
You are only human and we all make errors of some kind during our lifetime. If you break something, even accidentally, then you should always replace it after telling them. In case they find out later it will save you some issues and dignity too.
Maybe. I guess it's too late now.
I don't think it's ever too late to let someone know what happened. You should still tell him, and offer to pay for his new phone.