px (Pixels): Fixed size, does not scale with screen density. Avoid using it for UI elements.
dp (Density-independent Pixels) / dip (Same as dp): Scales with screen density, ensuring consistency across devices. Use for layout sizes, margins, and paddings.
sp (Scale-independent Pixels): Works like dp but also scales with user font settings. Use for text sizes to respect accessibility.
Use dp for layout, sp for text, and px only for precise pixel-based drawing.