What is multithreading, and how would you prevent race conditions or handle synchronization in your preferred programming language?