The electrostatic force between two charged particles is directly proportional to the product of the magnitude of the two charges and inversely proportional to square of the distance between the two charges.
Like charges (both positive or both negative) repel and opposite charges attract.