Most baking recipes call for unsalted butter instead of salted because the amount of salt in salted butter varies from brand to brand, and there’s no way to really know how much salt you’re getting in a stick. So if you’re following a typical recipe that calls for both salt and butter, and you choose to use salted butter, you could be adding quite a bit more salt via the butter than the recipe requires.
To give myself full control over the amount of salt in my baking, I only buy and use unsalted butter. But if all you have is salted butter, can you substitute it in a recipe? In a pinch, yes. Reduce the amount of salt called for by half, and if possible, taste and adjust as necessary.