All matter is made of atoms, which are composed of even smaller particles: protons, neutrons, and electrons. Protons and neutrons are located in the nucleus of the atom, and electrons move around the nucleus. Protons have a positive charge, neutrons have no charge, and electrons have a negative charge. Elemental atoms are typically neutrally charged, meaning that they have an equal number of protons and electrons. However, when an atom gains or loses electrons, it becomes a charged particle called an ion. A positively charged ion contains more protons than electrons; a negatively charged ion contains more electrons than protons.
The force between charged objects is known as electric force. Opposite charges (for example, a positively charged particle and a negatively charged particle) attract each other. In contrast, like charges (for example, two positively charged particles) repel each other. A neutral object is also attracted to a charged object because it becomes polarized by a process known as induction—being near the charged object causes the electrons in the neutral object to redistribute (toward a positively charged object or away from a negatively charged object) so that one side of the object develops a negative charge while the other side develops a positive charge.
You are probably familiar with everyday examples of electric force. Have you ever picked up two socks from the dryer and had them repel one another? Both socks became positively charged as they tumbled around the dryer and electrons rubbed off them. Because they are both positively charged, there is a repulsive force. If you rub a balloon on your hair, it picks up extra electrons and becomes negatively charged. You can then "stick" the balloon to a wall because of the attractive force between the negatively charged balloon and the neutral wall.
The electric force between two static charges can be calculated using Coulomb's law, F= kq1q2/d2. It describes the electric force acting on a charge, q1, in the presence of another charge, q2 (where k is a constant known as Coulomb's constant, and d is the distance between the charges). Using this law, a negative force value describes an attractive force. The strength of the electric force is proportional to the strength of the charges; it is also inversely proportional to the square of the distance between the charges.
Within an atom, Coulomb's law can also describe the force between the positively charged nucleus and negatively charged electrons. Electrons can be thought of as occupying varying energy levels around the nucleus; electrons that are closer to the nucleus are more strongly bound, and therefore it takes more energy to remove an inner electron than an outer electron. Although there is a repulsive force between the protons in the nucleus, it stays intact because the protons and neutrons are bound together by the strong nuclear force, which is much stronger than the repulsive electric force.