That's more difficult. "I'm an expert in medicine/science/law" but "I'm an expert on diabetes/butterflies". "In" means "in a certain field." "On" means "on something specific". Sometimes either term can be used.
Oh, and sometimes you can use 'at'. "I'm an expert at this type of thing." This is normally used for some type of action, eg. "I'm an expert at translating Bulgarian into Latvian".
Oh, and sometimes you can use 'at'. "I'm an expert at this type of thing." This is normally used for some type of action, eg. "I'm an expert at translating Bulgarian into Latvian".