I got fired. They fired me.
I got the sack. They sacked me.
They gave me the sack.
I got dismissed. They dismissed me.
These all mean the same thing: They took away my job; they terminated my employment.
"Discharge" is less common. It's used by the military (and perhaps in some other professions (?)).
If you want to leave a job yourself, you say:
I resign. I quit. I'm leaving.