Foreshadowing is a literary technique in which the author provides hints of future events in the plot. In James Hurst's short story, the Scarlet Ibis itself can be considered an example of foreshadowing.
Consider this unique bird: it is not native to the setting in which the story takes place, so therefore it is rather odd that this bird has ended up where they are, falling at their feet. The ibis does not fit in, is out of place--just like Doodle is in his world. If you pay attention to the description of the bird, it is very similar to Doodle's character--in other words, the ibis is a symbol of Doodle. If we then follow what happens to the symbol, we can get a glimpse of what might happen in the story later on.
At the end of the story, Doodle dies in much the same way as the bird dies; hence, the death of the ibis is an example of foreshadowing.
I included a link to some other examples of foreshadowing if you want to take a look as well.