I was just thinking about what it would take to see Pep Guardiola getting fired!

I have always thought that it is impossible for him to ever lose his job and I still think it is, but from a hypothetical point of view, I wonder when a club's management would decide to sack him?

Four losses is of course not enough. He could probably lose 8 consecutive games and still wouldn't get fired. Probably 12... But it is a new situation that Pep Guardiola hasn't been in yet. This could either snowball and Manchester City is far more nervous than usually or they will soon answer with an impressive winning streak.
Even if Pep Guardiola lose more than half of the matches he will play this season, I don't think Manchester city will ever think of firing him because his achievements so far is bigger than just one season of bad results. Pep Guardiola is the man that made Manchester city what they are today. He transformed the club to what we are seeing today, so there is no amount of bad results that he will have this season that will make his club sack him. Just like every aspect of human lives, things ain't always good all the time, so it is just one of those things in life. We have seen Pep lose matches in the past and he always comes back stronger. Pep Guardiola is definitely going to respond with winning streaks. There are managers that are beyond sacking and Guardiola has earn that badge of a manager that's beyond sacking in my opinion.
Manchester City declining performance is indeed surprising to us, especially with Guardiola reputation so far as one of the best coaches in the world, but it is undeniable that the injuries of key players such as KDB and Rodri have had a huge impact on their performance and also consistency this season, especially so far they no have a strong squad depth after not doing much transfer activity last summer, consecutive defeats and maybe even his failure to win the trophy this season will not affect his position as a coach, even now their had trying hard to extend Guardiola contract which is indeed one more season left, I think the management and fans will of course understand the possibility of failing to be championship this season, because they still really appreciate what Guardiola has given to Manchester City so far.