God uses man all the time to bring forth His will. It was God's will that David took out Goliath. And it had to be David who did it because David gave all the glory to God.
You're right. But David did not kill King Saul. And he forbade any of his men to do so. Saul's death was in God's time and manner, not David's.