I just need to spin the motor, one direction, for about a second. It is for an automatic food dispenser, so just a burst for a second or so
Unidirectional control of a DC motor is typically accomplished with an N-FET switching the motor's negative power lead, while the positive remains permanently connected to the supply.
Many of the best modern FETs for this kind of role are in surface mount packages, but if you prefer a through-hole package, Adafruit sells the IRLB8721PBF (data sheet) for this type of purpose. The main factor of importance is not the ultimate current rating, but rather that with the 3.3 volts the pi can supply to the FET gate, the FET will be reasonably (and not just minimally) "on".
Given that a motor is an inductive load which exhibits a "kick" when turned off, you'll also need a diode "backwards" across the motor.
And you'll want a 10K or so pull-down resistor on the FET gate.
Some might suggest using a relay module for this task; that is a path you can pursue but there have been some anecodotal reports of the cheap undocumented e-commerce site relay modules sometimes not working reliably with 3.3 volt input, as they sometimes have optocouplers set up in a way that assumes 5 volt logic from an Arduino. The potential isolation provided by a relay and optocoupler is substantially (if not entirely) defeated when you use the same power supply for both the computer and the motor.
(Incidentally, if you could use an Arduino, that would probably make your project a lot more robust than a pi, which as extremely complex system with far more things that can go wrong).
and I don't know exactly what type of motor I need for that
This is worrisome, until you've picked the motor it's impossible to say much of anything about power supply requirements. Fortunately TO-220 size FET's are likely overkill for the switching requirement. Your picture made it seem like you were considering a gear motor, which could indeed be a good choice for slow one-way movement.
For example, do I split the 12 volts DC coming in, and send 12 volts to the motor and then do some resisters to lower the 12 volts to 5 volts to power the raspberry pi?
Loads of time-varying power requirement like a Raspberry Pi cannot be supplied through a resistor. They'd need a voltage regulator. In the very old days a Linear Voltage regulator (which is basically a resistor which self adjusts for load) might have been used, but a pi consumes so much power that this would generate a lot of heat. So today, instead you would use a Switching Regulator. The LM2596 is a relatively old and not terribly sophisticated part compared to what is on the market for such purposes now, but it would probably work, and the Internet is full of places selling modules with something comparable (if not literally) that on them. Pick one where any adjustment is via a screw type potentiometer and carefully pre-set it while measuring the output voltage; you don't want something that will fry your pi if bumped out of adjustment.