should i remove trim before caulking window
Adding expanding foam around windows and doors is a cheap way to add insulation. If you're willing to do the extra work involved in removing and reinstalling the trim, it's definitely worth doing. 

Adding caulk alone might stop drafts but isn't as good of a thermal break. 

Make sure you use an expanding foam that is specifically for windows and doors. This product will not expand as much in order to prevent malforming the frame.