What I mean is that I have seen for example in Bootstrap you can either download it and put a like mini link in your text editor or you can just put a cdn link although it is a bit longer, and I have seen the same with Jquery , you can choose between putting a cdn link and downloading it. What is the difference and which one is more recommended to use?
First of all, neither one nor the other is recommended, it really depends on each project.
The other answer, which was accepted, explains two points that are not entirely true:
Using a CDN does NOT guarantee that the site will load faster. The CDN servers may be down or the connection to them very slow, among other possible reasons.
Both files stored on the same server as the page/website and a CDN will take a while to load, even 1ms, but both take time.
There is a similar question on SO in English with slightly more detailed answers, which I translate below:
Advantages of using CDN
When not to use a CDN
Another point to keep in mind is that it may be a better idea to concatenate all the scripts and put them in a single file (example scripts.js), than to use a CDN, due to latency issues on certain devices, although apparently this is no longer the case. a problem with HTTP2.
The difference lies in the loading time of your site.
CDN
your site does not load faster, the difference is very little.Now if it happens that the link or file has been damaged or moved
CDN:
Download: