Certain foods can irritate some types of hernias and cause pain. Hot, cold, or spicy foods tend to be the biggest culprits and should be avoided. Relaxing, taking warm baths, and not engaging in vigorous physical activities or exercises can also help to reduce pain. Pain medications are also an option. Consulting with a doctor can lead to recommendations for each specific type of hernia.