We consider the problem of estimating an unknown density or regression curve from data. In the parametric setting, the curve to estimate is modelled by a function which is known up to the value of a finite number of parameters. We consider the nonparametric setting, where the curve is not modelled a priori. We focus on kernel methods, which are popular nonparametric techniques that can be used for both density and regression estimation. While these methods are appropriate when the data are observed accurately, they cannot be directly applied to astronomical data, which are often measured with a certain degree of error. It is well known in the statistics literature that when the observations are measured with errors, nonparametric procedures become biased, and need to be adjusted for the errors. Correction techniques have been developed, and are often referred to as deconvolution methods. We introduce those methods, in both the homoscedastic and heteroscedastic error cases, and discuss their practical implementation.