Fourier transform of a signal
Are you familiar with the multiplication/convolution rules for FT's?

The FT of a product of functions is equal to the convolution of the FT of each function $$ F(a \times b) = F(a) * F(b)$$

The FT of an infinite cosine is straightforward.

The FT of a rectangular pulse is also a very common standard transform, worth learning and committing to heart if you haven't already.

The convolution of those two transforms is the transform you seek. As the FT of the cosine is merely two spectral lines, the convolution is easy enough to be done by inspection.