System detected cooling fan is not working properly

Hello, I was working on my HP laptop then suddenly the screen turns black there’s an error message on my screen that say’s the system has detected that a cooling fan is not working properly then it shuts off. What do you think is the reason why this happen? Will the fan needs to be replaced?
