i know the formula

FC = # Valence Electron - bonds - lone pairs

but am i supposed to use that formula for all elements on the problems
for instance the teacher did this example

:O:
||
C
/ \

O FC: 6-2-4=0
CFC: 4-4=0

I have no idea where the numbers came from, can someone explain simply how to find the numbers i need to plug in?

For O.

valence electrons = 6 (periodic table)
bonds = 2 (Lewis diagram)
lone pairs = 2 lone pairs or 4 electrons.
6-2-4=0

For C.
valence electrons = 4
bond = 4
lone pairs = 0
4-4-0 = 0
Frankly, I don't like this method of doing it but it works.

is there a different way to do this problem?

Yes, but it's hard to explain without a whiteboard. However, I'll try.

Count electrons by themselves. Count electrons in a bond as belonging to each atom equally; that is, if two electrons make a bond then 1 electron belongs to one element and the other element belongs to the other element. Then the formal charge is determined by comparing the electrons the element normally has to the electrons you just counted. Here is how it works.
For the compound you posted, O has 4 non-bonding electrons and 2 in the bond with C (the C=O). [There are 4 electrons in the C=O bond so half belong to C and half to O making O now with 4 + 2 = 6.] How many valence electrons does O have? It has six since O is a group 6 element; therefore, the formal charge is zero. Now for C. The C has 2 electrons from the C=O bond, 1 electrons from 1 C-H bond and another electrons from the other C-H bond, which makes 2 + 2 or 4 total. The number of valence electrons for C is 4; therefore, the formal charge is zero.
Draw N2O
..
:O:
..
N
..
..
..
N
..
Top O. You have 6 electrons not involved in bonding and 2 shared. Electrons we count as belonging to O is 7; O normally has 6, FC is -1
Top N. We count 1e in N-O bond and 3 in the NtriplebondN which makes 4. N is in group V so it normally has 5 which makes it +1. Lower N is 3 for the triple bond and two non-bonding which makes 5; formal charge is zero. Molecule is zero since you have a +1 and a -1.
I think it is far simpler to count the electrons than it is to try and put them into a formula. I can have the electrons counted by the time I can figure out the three numbers to put into the formula we used in the first post. I hope this is of some use to you.

that makes a lot of sense , thank you i was really confused.

To determine the numbers to plug into the formula FC = # Valence Electrons - Bonds - Lone Pairs, you need to follow a few steps:

1. Identify the central atom: In the given example, the central atom is carbon (C).

2. Determine the total number of valence electrons: Valence electrons are the outermost electrons of an atom and are involved in bonding. The number of valence electrons is typically equal to the group number of the element in the periodic table. For example, carbon is in Group 4, so it has 4 valence electrons.

3. Count the number of bonds: Count the number of bonds formed by the central atom. In the given example, carbon is bonded to two other atoms (one oxygen and one hydrogen), so it forms two bonds.

4. Count the number of lone pairs: Count the number of non-bonding electron pairs on the central atom. In the given example, carbon has no lone pairs.

5. Substitute the values into the formula: Now that you have the information, you can plug the numbers into the formula FC = # Valence Electrons - Bonds - Lone Pairs.

For oxygen (O):
- Valence Electrons = 6 (oxygen is in Group 6)
- Bonds = 2 (oxygen forms two bonds with carbon)
- Lone Pairs = 4 (oxygen has four non-bonding electrons)

Substituting into the formula: FC = 6 - 2 - 4 = 0

For carbon (C):
- Valence Electrons = 4 (carbon is in Group 4)
- Bonds = 4 (carbon forms four bonds with oxygen and hydrogen)
- Lone Pairs = 0 (carbon has no non-bonding electrons)

Substituting into the formula: FC = 4 - 4 = 0

Therefore, the formal charges for both oxygen and carbon in this molecule are 0.

Remember to apply this formula to all the elements in a molecule and calculate their formal charges individually. It helps to draw the Lewis structure of the molecule to correctly identify the central atom and determine the number of bonds and lone pairs.