This is a common question I get asked a lot and people are usually surprised that they already have a solution laying around in their house somewhere. There are many products out there that can remove tree sap, but the product I always reach for first is isopropyl alcohol (IPA). It’s cheap, safe, effective, and it can be found at pretty much any local grocery store. After thoroughly washing the vehicle, simply spray it onto the surface allowing it to dwell for bit, and then gently rub with a soft cloth dampened in isopropyl alcohol. Be sure to only use light pressure and turn the microfiber often to reveal a clean area to avoid marring the painted finish.
By using IPA (or other products) to remove the sap, you will also remove any wax or sealant in that area so it is recommended that you re-apply your favorite wax or sealant at least in that area when finished with the sap removal.
Note: With older dried sap, longer dwelling/rubbing time may be required for it to be removed. If the sap has etched into the paint it will require some measure of polishing or wet sanding to be removed. Extreme etching may be beyond the point of repair and will require a repaint.
Hope this helps.