I like how you emphasize "formal" in your question. This is an important point, because the Empire had been in decline for a long time. Some historians would probably say that Rome had been in decline since the emperor Marcus Aurelius as he was campaining against the Germanic tribes. Also the empire was getting to big to handle. To be sure the empire strikes back (I could not resist) under emperor Diocletian with his new form of government, but this is not a permenant solution. There are other problems such as hyper-inflation, lack of civic pride and military weakness. Finally, when the empire moves more and more east, the west is left to fall and 476 marks the end.
The event in 476 BCE that marks the formal end of the Western Roman Empire came when the barbarian king Odoacer (aka Odovacar) became king of the empire.
By 476, the empire had been in decline for quite some time. Of course, it had been split between Rome and Constantinople back in the 300s.
After that, there was a great deal of pressure from barbarian invasions. This pressure became great enough that the capital was moved to Ravenna (which was more defensible) in 404.
After that, Rome was sacked by barbarians in 410.
All of these things weakened Rome, but the official end comes when Odoacer becomes king.