Electroencephalography (EEG) is the recording of electrical activity along the scalp produced by the firing of neurons within the brain. These activities can be decoded by signal processing techniques, however, they are typically influenced by extraneous interference, like muscle movements, eye blinks, eye movements, background noise, etc. Therefore, a preprocessing step to remove artifacts is extremely important. This paper presents an effective artifact removal algorithm, based on Independent Component Analysis (ICA) and Hierarchical Clustering. Our technique utilizes general temporal and spectral features and particular information about target Event-Related Potentials (ERPs) (e.g. the timing of N200 and P300 on inhibition task or the specific electrodes contributing to the ERPs) to separate ERPs and artifact activities. Our method considers templates for desired ERPs to select event-related components for signal reconstruction. In our experimental study, we show that our proposed method can effectively enhance the ERPs for all fifteen subjects in the study, even for those that barely display ERPs in the raw recordings.