People living in non muslim countires often donot know that the food they are eating is halal or haram. what should they do in this case?
Generally speaking it is always best to ask or investigate - especially if you are not sure if what you eating is Halal. If in doubt its best to leave/avoid. Depending upon the country there are often resources on the internet that can provide advice for Muslims on places to eat, ingredients and Halal/Haram matters.
If you are eating out or at a friends then it is easy enough to ask if the meat and/or ingredients are Halal. If you are buying processed food then it is generally easy enough to check the ingredients, though this in itself may require further research to understand what ingredients are permissable etc. Many vegan/vegetarian foods are often labelled accordingly but that does not mean that they are Halal as they may contain alcohol so you have to be careful.
Ultimately you have to use some intelligence and common sense, its not always straight forward but you should be able to work out to a reasonable degree whether something is permissible or not.
JAK And Allah SWT knows best