I mean when you use a single sound, for example a sample kick. Why should i use a compressor when i could use an eq easily? So i would just easily decrease or increase the frequency i want. Do they do the same thing?
They do not do the same thing.
Compressor: when the sound gets above a threshold, its volume is reduced in a set ratio (3:1 means for every 3 dB increase in the input signal you get 1 dB increase in the output). This is helpful for reducing the dynamic range of an instrument.
Equalizer: reduces/amplifies all sounds (regardless of their level) by a set amount (e.g. -3 dB) instead of a ratio. This is helpful for changing the frequency characteristics of an instrument, but does nothing to reduce the dynamic range.
A kickdrum does not produce "a single sound", it produces a broad frequency spectrum, so you'd have to set up a very broad filter on your EQ. You might as well reduce the input gain instead.
A compressor’s typical use case is to narrow the spread between the loudest parts of the sound across all frequencies while an eq is designed to enhance/reduce the levels of certain frequency ranges.
If you have a fairly narrow band of frequencies to work with, you’d achieve the same effect from adjusting the right eq band as a compressor. The difference between the two becomes more apparent when you working with a wider band of frequencies (e.g. a piano playing at different octaves).
I would typically utilize EQ to affect the tonal aspect of a given track or instrument, whereas I use compressors to affect the dynamics and sometimes to increase the sustain of a track or instrument. These are two different characteristics of sound by themselves and I often use them together to achieve results I cannot achieve without combining them together. When I first learned to use these toys, I studied everything I could get my hands on to understand what they did and how they functioned, but until I spent many hours playing with them and listening to the results, my initial understanding of their capabilities was incomplete. Book learning is only the beginning, be prepared to spend time getting to know the "feel" of what these devices can do. Welcome to this site.