How does an engine failure affect the flight of an airplane? I'm not even close to an aviation enthusiast, but after watching some videos I found I have a deep misunderstanding on how airplanes work.

.

I've seen many cases where one of the engines fail and the plane has to fly on a single engine for a long time.

How doesn't the fact that the forces are now uneven drive the airplane to a side drift? (I'm sure this is all wrong, but I just don't understand how)
It does.  Asymmetric thrust will in fact force the airplane into a turn unless the pilot counteracts this by using rudder and aileron to command an equal turn force in the other direction.  Typically both opposing rudder, and banking away from the dead engine will be used to result in straight (although uncoordinated) flight.