Memory and unused functions in a library

well not exactly a library just another c file and header file , ive yet to learn about libraries and linking so for now i am only writing things in separate c and h files
but i wonder if i write a generic c file with multiple functions for doing a lot of tasks but i only use some of them in my main c file do the unused ones take up memory?

The compiler is smart enough to get rid of unused code. Of course, you could always write small example and test it yourself.

Sometimes a class or variable or interrupt routine is still in the compiled file, even when it is not used.

I use defines to disable blocks of code.

// Select which one to use

// #define ENABLE_I2C
// #define ENABLE_BLINKING_LED
#define ENABLE_TEMPERATURE

...

#ifdef ENABLE_TEMPERATURE
  // do someting with the temperature sensor
  float temperature = getTemperature();
  Serial.println( temperature);
#endif