If bar may occur on consecutive lines, you could do:
awk '/bar/{n=2}; n {n--; next}; 1' < infile > outfile which can be adapted to delete more than 2 lines by changing the 2 above with the number of lines to delete including the matching one.
If not, it's easily done in sed with @MichaelRollins' solution@MichaelRollins' solution or:
sed '/bar/,/^/d' < infile > outfile