You likely mean The Cable Guy (1996), starring Jim Carrey as Chip Douglas.
Chip befriends Steven (Matthew Broderick), then obsessively infiltrates his life. He doesn’t explicitly “try to kill three kids,” but he:
The “foster kids / parents died in fire” detail may blend with another film (e.g., The Good Son – Macaulay Culkin, Elijah Wood). Carrey’s Chip is a dark comedy stalker, not a child murderer.