I need to create a .webpart file from my visual studio project so that I can upload it to my sharepoint site and insert it into one of my pages as a web part. I can't create a webpart project to begin with, because I'm not developing on Sharepoint foundation/server. However I can create sharepoint add-in projects, and add web parts to the project, how can I actually go about creating the .webpart file? Is this even possible without developing from a sharepoint foundation installed windows server OS? Thank you for your time!
You can't develop actual Web parts for SharePoint Online. I mean: you cannot deploy real Web parts in SPO.
A Web part is made of a declarative XML file (the .webpart file your mentioning) and server-side code (hosted in a DLL/.NET assembly). Add-ins (aka apps) for SPO absolutely forbids server-side code. Thus, no custom Web part in SPO.
Add-ins come with something similar to Web parts: app parts. But technically app parts have nothing to do with Web part. They're purely declarative (in a simple XML file) and are actually a simple IFrame pointing to a configured URL external to the current site.