Ok so this is very simple concept
There are 3 ways known in which atoms bond ie join to each other. Every atom needs 8 electrons in their outermost shell(valence shell) to be stable. Stable means it does not react with other atoms and form more bonds. So if it is able to get 8 electrons in their outermost shell by combining with other atoms, then it becomes stable. Now once this part is clear, we can proceed further. Now an atom can have various no of electrons in their outermost shell(valence shell) ranging from 1 to 8. For example Sodium has 1, Magnesium has 2, Aluminium has 3, Chlorine has 7 and Neon has 8. Neon is stable( as u mention happy) because it has 8 electrons in the outermost shell.But what about the others (Sodium , Magnesium etc etc?) In their case, they need to seek help of other atoms by either taking electrons, giving electrons or sharing electrons.(also donating electrons but that is much more advanced. Right now we can skip that).
Now these atoms are pretty smart. If they have electrons less than or equal to 3, they will give away their electrons to some other atom which needs some. So instead of trying to find 5-7 more electrons, they simply give away their 1-3 electrons and depend on the prior shell which already has 8 electrons.On the other hand, atoms with 5 or more electrons will search for atoms which are ready to give away such electrons and take from them instead of losing 5-7 electrons which is a large no. This, is called electrovalent bond. A trick to remember
less thn 4= give electron
more than 4= take electron.
Whichever combination forms 8, match made :) for eg Sodium gives one electron, and Chlorine takes one which has 7 electrons. Or it could also be this way- 1 Magnesium has 2 electrons to give, while chlorine required only one, so they play smart. Instead of one chlorine, 2 chlorines come into picture as 2 chlorines require 2 electroms. They form MgCl2 (Magnesium Chloride).
Now the part where you may most likely be confused is covalent bonds, which are formed by "sharing" of electrons. In the previous case, it was not sharing, it was give and take. Sharing means both the participating atoms give, and both take. In previous case, it was 1 give one take. In this this case, it is both give and both take. How? Lets take example of O2 in this case. An oxygen atom has 6 valence electrons. So it requires 2 more.. how can it do so with another oxygen? Well, its quite simple. Oxygen takes two of its electrons and shares it with another oxygen, which in return also shares it with 2 electrons. They do not exactly LOSE their electrons to the other one, the 4 electrons 2 from atom a and two from atom B are shared, are in between, kind of like a tug of war with equal force on both sides. Thats covalent bond.
Phew, enough said, its more about how you visualize it. If you can visualize this, then congrats, you mastered the basics.