Once you have learnt the words for different types of vegetables in Croatian, then test yourself.
There is an entire page devoted to krastavac 'cucumber'.
It tells us (among other things), krastavac se ne bi trebao jesti navečer ni tijekom noći 'cucumber should not be eaten at night or during the day'.
It is also full of examples of krastavce in different cases. If you want to know how to use Croatian food (or vegetable words) in a sentence, then you have to understand the case system of Croatian Grammar.
An example taken from the same page is Ako jedeš krastavce ... 'If you eat cucumbers ...'. Krastavce is in accusative plural.
Another is using the u krastavcima 'in cucumbers'. The Croatian preposition u meaning 'in' is followed by the locative case.
A useful video by Simply Croatian describing Fruits and Vegetables. It is in Croatian with subtitles. If you want to listen more actively, listen out for dańašnja tema je voće i povrće 'todays subject is fruit and vegetables.', and vegetables karfiol 'cauliflower', brokula 'brocoli' and luk 'onion'.
Words to do with food. General, Words to do with food. Fruit, Words to do with food. Meat, Vegetables.