Use px/dp for defining precise visual elements such as padding, border, margin, and sometimes image sizes.
Use em/sp for defining font and icon sizes so that your app respects the users' font-size preferences.