Components/SWC

How do you make components/SWC files? Are they same thing? I would like to build an API, but I don’t know where to begin. Hopefully I am making sense.

Can anyone please tell me or link me a resource on how to make a SWC?

Thank you