What happens in a game if the ref interferes with a play such as the ball hits him or he unintentionally blocks a play?

I don’t think I have seen such an event which says a lot about how well trained they are but wondered if they interfered with a play which could prevent a touchdown or a first and ten what do they do?

TIA