A squash is a new world vine fruit with a starchy flesh that people usually eat as a vegetable. A vegetable is any part of a plant that is eaten as part of a savory meal. Leaves, stems, roots, flower buds, and fruits are all used as vegetables. We tend to reserve the word "fruit" for when a plant fruit is being used for a jam or a dessert, and avoid calling fruits like tomatoes, peppers, eggplants, and squash "fruits" because it can be confusing.
Pumpkin is a squash.