A library implements an API. For example printf() is part of the file I/O API, and it is implemented by the C runtime library. Similarly sin cos tan are part of the math API, and are implemented by libm.a. So this has two implications for your application: (1) your code must #include the relevant header file (which defines the API) and (2) your executable must be linked with the relevant library.

#include <math.h>
#include <stdio.h>

int main()
  double x=30;
  double sinx=sin(x);
  printf("sin of %e is %e\n",x,sinx);
  return 0;

gcc -c test.c -o test.o   // compile test.c to object
gcc test.o libm.a -o test    // link test.o and libm.a together to make test executable

or in one step
gcc test.c -lm -o test
Not tested so I might have missed something obvious, but that's the gist of it.

The linker has a shortcut -l where if you specify -lX, the linker goes off in search of libX.a (where X is anything). So libm.a can be abbreviated -lm.