Agarose gel electrophoresis is used for the separation of nucleic acid i.e. DNA and RNA on the basis of their size. DNA and RNA are negatively charged so they migrate towards anode but the shorter fragments will move faster and hence the separation will occur.
Agarose gel electrophoresis is sometimes also used for the separation of proteins.