DC Motors - problems

A little delving found this: https://www.researchgate.net/figure/The-connection-circuitry-of-the-ARDUINO-L298N-with-2-DC-Motors_fig16_315337631 which looks promising. Note you need 8 diodes on the outputs or you'll risk blowing up the chip. Its usually easier to use this package in the form of a module
complete with diodes and heatsink and screw terminals.