The Cosmere is extremely complex, but the bare-bones basics are that long ago, on the planet Yolen, within the dwarf galaxy known as the Cosmere, the deity/force (nobody knows) Adonalsium was broken, in an event known as the Shattering, into sixteen Shards of immense power, each taken up by a mortal, who Ascended to near-godhood via their power. These Shards of Adonalsium are the sources of the many magic systems in the Cosmere, and often play a large role in later works in any given series set in the Cosmere. Within the Cosmere are Shardworlds, planets visited by the Shards of Adonalsium, and most of Sanderson's Cosmere works are set on them.
Lots of other users can explain it better than I can, and the Coppermind is a great resource.
https://coppermind.net/wiki/Cosmere