Based on your description, you are likely describing a striped cucumber beetle.
These beetles are about 1/4 inch long, have black bodies, and feature three distinct yellow vertical stripes on their backs. They are commonly found in gardens near cucurbit plants like cucumbers, squash, and melons, where they feed on leaves and stems.
Other insects have similar characteristics, so it is best to confirm with a visual reference or identification guide based on where and how you saw the insect.