The Jebusites were one of the Canaanite peoples whom God had promised to drive out of Canaan. They lived in the south of what was to become Israel, on the slopes of the hill country, where Jerusalem was located (Joshua 11:3 and 15:8).
They lost the first battle against the invading Israelite army:
Judges 1:8 The men of Judah attacked Jerusalem and captured it, killing all its people and setting the city on fire.
But it was a short-lived victory. It seems the Israelites had a tendency to win a city in battle, then move on to the next battle, only to find the first city resettled when they returned. It’s one of the reasons the Israelites had to occupy the land after taking it.
In this case, Jerusalem had been taken, but the Jebusites still occupied the slopes of the hill country around it. Benjamin couldn’t drive them out, so they simply moved back into Jerusalem and rebuilt:
Judges 1:21 The tribe of Benjamin, however, failed to drive out the Jebusites, who were living in Jerusalem. So to this day the Jebusites live in Jerusalem among the people of Benjamin.
They were still there when the book of Judges was written.
Hundreds of years later, after the exiles had returned from Babylon, Ezra called for repentance: the men had married women from the Jebusites and others, which affected their fidelity towards God.
Then they disappear from history.
The popular theory is that they were eventually assimilated into the peoples around them. Or perhaps they were scattered with each wave of invasion and occupation. Without a Jewish-style ban on ethnic intermarriage, the Jebusites simply disappeared as a separate people group.