You can use a circuit like this: 

The particular [MOSFET shown][1] will handle easily 6A or more without getting too hot, however the diode D1 should be upgraded if the current is more than a couple of amperes (eg. 1N5405). The main missing piece of information is the solenoid current.

Look at the datasheet for the MOSFET and see if you can predict the power dissipation when on. The resistor R2 is to turn the MOSFET off if the drive line goes open circuit. R1 slows the switching a bit and may help to protect your MCU if something bad happens.

<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.sstatic.net/MlelA.png)

<!-- End schematic -->

If you use an NPN transistor you will have to supply a lot of base current (typically about 1/10 to 1/20 of the solenoid current), which will require at least another transistor to drive the NPN unless the solenoid is very low current. One possible configuration to do that is with a darlington, but that drops about 1V so the transistor will get hot if the solenoid draws much current. If your 3.3V supply can handle the base current it would be better to use a PNP + NPN transistor (active low input). Switching is hard on the output transistor so one with a good safe operating area (SOA) needs to be considered to avoid 2nd breakdown failure. 


  [1]: https://media.digikey.com/pdf/Data%20Sheets/Fairchild%20PDFs/FDD,FDU3706.pdf