Without seeing your save, there are two possible ideas: Yugoslavia was probably guaranteed because you either attacked too early, or too late.
1. France guarantees Yugoslavia from the start of the game, and only removes this guarantee when/if they let Hitler have the Sudetenland. If France+UK didn't let Hitler have the Sudetenland yet, (because it hasn't happened or maybe won't if you're off of historical focuses) you're facing the French guarantee. If you're watching a pre-2020 tutorial, they didn't have to deal with this because France didn't guarantee Yugoslavia from the start until the La Résistance expansion.
2. If world tension is above 25%, any democratic nation can start guarantees. So if the game had gone long enough for this much world tension, the UK could very well have guaranteed Yugoslavia.
For future reference, you can always check "will someone join the war to defend someone I'm about to attack?" When you click "declare war," you get a screen where you select your wargoal and get to see who will defend the nation in question. (which for you was probably Britain/France and maybe Romania)
Welcome to the HOI4 community, and good luck on your future games! Most of us, myself included, learned a lot by trying something and failing it.