I’ve been using fans as white noise generators for decades. When staying in a hotel room, I run the bathroom fan if it’s loud enough. It’s a great way to drown out thoughts if you have trouble falling asleep.
You might want to consider investing in something like a Babelio sound machine. It's tiny, quite loud, kinder to the environment and will guarantee you have a solution if the bathroom is too far away or the outside noise is a bit too aggressive.