The first step is to define how you are going to power the fan. For safety, it is convenient that you can turn it off or on at any time. To do this you can use a relay board, there are 2, 4, or 8, depending on what you want to connect. There are already relay boards that work with 3.3V...