How to use 'ie' or 'ei'

How to use 'ie' or 'ei'