4-20 mA sensor output to STM32 ADC input
You'll need a linear current to voltage converter.



simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. Full schematic of a linear current to voltage converter.
If the ADC is 0 to 5 V then set R1 to 250 Ω. Your 4 - 20 mA will give an input of 1 to 5 V so you'll lose 20% of your useful range but this is a small price for the simplicity.
0.1% resistors and even 0.01% are available in a few key values for standard conversion voltages but may be a bit pricey for you.

From the comments:

I said best because I need a system that can last long time without any damage for Stm32. So, 150 ohm resistor can not be sufficent for me.

That should have been a specification in the question. (It still is not there.)
A resistor solution can last forever if the system is not abused. Again, this is a missing specification requirement and you need to specify in your question what abuse and fault conditions you need to protect against.

Also, I have sensor which has 12-24v range.

No, you said you have a 4 - 20 mA sensor. It most likely can be powered by a 12 to 24 V (capital 'V') power supply. The maximum output voltage will be determined by the output current and the shunt resistor, R1 in this case.

Link to ad page supplied in comments:

Figure 2. The 2-wire transmitter.
You have selected a 2-wire transmitter. The circuit of Figure 1 is perfectly suited for this. As a precaution you can test the worst case current from the transmitter by replacing &quot;Instruments&quot; with your multimeter in mA mode. Then pressurise the switch to the maximum pressure it will ever see in service and read the current. If it goes a bit over 20 mA then reduce the value of R1 accordingly.
Note that you have chosen a device with no datasheet and that the illustration says &quot;current dutput&quot;. That may be an indication of product quality. &quot;No datasheet? No sale!&quot; is a good motto.