Basically, we use the Fourier sine/cosine series when we have an even or odd function (over interval [itex] [-L, L] [/itex]) which allows us to take advantage of the even/oddness of cosine/sine. If we have an odd function f(x):
[itex] f_{o}(x) = -f(-x) [/itex] on [itex] [-L, 0] [/itex] and [itex] f(x) [/itex] on [itex] [0, L] [/itex]

When the function is not even or odd over [-L, L], the general form must be used, although if we just have a simple function over [0, L], when can actually choose to "extend it" as an even or an odd function.

Laplace Transforms:
The nice thing about Laplace transforms is that they turn differential equations into algebraic ones by breaking down higher order functions. Generally they are most useful when dealing with an equation involving unusual functions, such as Dirac delta functions or unit step functions. When you're dealing with those, Laplace is the most simple way to solve the equation (in fact it's the only way I know how to.)

Basically, we use the Fourier sine/cosine series when we have an even or odd function (over interval [itex] [-L, L] [/itex]) which allows us to take advantage of the even/oddness of cosine/sine. If we have an odd function f(x):
[itex] f_{o}(x) = -f(-x) [/itex] on [itex] [-L, 0] [/itex] and [itex] f(x) [/itex] on [itex] [0, L] [/itex]

When the function is not even or odd over [-L, L], the general form must be used, although if we just have a simple function over [0, L], when can actually choose to "extend it" as an even or an odd function.

To clarify for the OP, the fourier series is a series representation of a periodic function. If you compute the fourier series of a non-periodic function g(x) on the domain [-L,L] (for example), the fourier series will match g(x) for x in [-L,L], but the pattern repeats for x outside of that range with period 2L.

Fourier series sometimes appear in solutions of Partial differential equations.

They do share similar features with the fourier transform, which I believe is what the OP is asking about. The fourier transform is

$$F(\omega) = \int_{-\infty}^\infty dt f(t) e^{-i\omega t}$$
(up to a choice of the sign of i in the exponent and a factor of ##1/\sqrt{2\pi}## in the front). As you can see from this definition, any true function which has a fourier transform must be non-singular on the entire real line and it must tend to zero at the infinities. I have written the above equation in terms of time and frequency, but I could just as well have written it in terms of position x and spatial frequency k. When solving differential equations, you would use the fourier transform when your coordinate can take any real number value (e.g., solving for something as a function of the position, where the position can be from -infinity to infinity), and typically when your solution will decay to zero at the boundaries.

The cosine transform is basically just the fourier transform applied to an even function. Because ##e^{i\omega t} = \cos(\omega t) + i\sin(\omega t)##, if your fourier transform over an even function, the imaginary term is zero (because it is odd) and the real part of the integral is just double the integral over the positive part of the real line.

Lastly, though I noted that for the fourier transform to be well defined it must be applied to a function which has no singularities and decays to zero at the infinities, one can actually extend the domain of functions which can be fourier transformed by allowing results in terms of "generalized" functions like the Dirac delta function or the Heaviside step function. By allowing these functions to be results of a fourier transform, you can take the fourier transform of a constant, sin(x) or cos(x), 1/x, of powers of x, etc. See wikipedia for a list of such transforms.

Laplace Transforms:
The nice thing about Laplace transforms is that they turn differential equations into algebraic ones by breaking down higher order functions. Generally they are most useful when dealing with an equation involving unusual functions, such as Dirac delta functions or unit step functions. When you're dealing with those, Laplace is the most simple way to solve the equation (in fact it's the only way I know how to.)

If it's an ODE with a Dirac delta function or Heaviside step function on the RHS you can always solve the equation piece-wise and match the solutions at the boundary.