Notch filter on STM32 Microcontrollers
How much attenuation do you need, and what's your sample rate?

If you only need moderate amounts of attenuation, Finite Impulse Response filters are very amenable to implementation on a microcontroller. They aren't necessarily as computationally efficient as Infinite Impulse Response filters for comparable attenuation, but they are unconditionally stable, and are easy to implement in fixed-point arithmetic (IIR filters run into stability problems in fixed-point).

FIR complexity grows with the square of the length of the filter (ie: \$O(n^2)\$), so if you need a lot of attenuation at a high sample rate you probably want to look at something else like a floating point IIR notch filter. You can reduce the complexity of an FIR filter to \$O(n\log n)\$ using an FFT-based algorithm, but that generally only becomes necessary on really long filters (and has real-time implications, since you process the filter in "blocks" at a time rather than continuously).

For computing the filter coefficients, you have a few options. You can do it yourself - the most common method is the window method, which works on prototypes based on a sinc function multiplied by a windowing function. You can also do it with the help of a software library: there are various Python libraries for digital filter design, and you can also use MATLAB if you have the DSP toolbox.

Personally, I quite like T-Filter, which is a little online utility that you can use for FIR filter design: you specify your various passbands, stopbands, and ripple specs, and then let the tool do its job. It even will auto-generate an implementation in C that you can drop right in your firmware project, which is very handy.