When you look at Germany the only route their they could have taken was either the North Sea or the British channel. Did their ships cross the channel? Or did they go all the way around the Scotland? How could they maintain any sort of sea fleet where they had to do either? The English Channel would have been a difficult journey and the North Sea is such a long way.
Generally speaking, German ships and submarines would take the route through the North Sea and around Scotland to reach the Atlantic. The English Channel was, at least in WWI, too heavily mined and guarded for surface ships to make the trip, though submarines often did.
In WWI, the Royal Navy and French Navy blocked the English Channel. This was achieved using a combination of mines, nets and surface patrols, forming what's known as the Dover Barrage. It was laid in the narrowest part of the Channel, the Dover Strait. The Barrage was primarily an anti-submarine weapon, but the mass of mines was also useful against surface ships. It was a multi-layered, complex defense. The hope was that the mines and nets would preclude any submarine trying to make it through the Strait submerged. Instead, they would have to run through on the surface, where the patrols could find and catch them. It was a large effort, requiring thousands of mines - 4390 mines were laid in the Barrage in February 1915, with 1471 more being added in June. However, it was initially ineffective. Bad weather would sweep many mines away, meaning that the minefields required more maintenance than originally expected. The patrols were, initially, ineffective, being poorly laid out and not well equipped to catch submarines travelling through the Straits at night. Over the course of the war, though, they would be whipped into shape, especially after Admiral Keyes took command in January 1918. The Dover Barrage discouraged many U-boat commanders from travelling through the Channel, causing them to instead travel round Scotland. A total of 28 subs were sunk by mines in the vicinity of the Barrage, and several more by the surface patrols.
At the outset of WWII, the British and French again established a barrage in the Dover Straits. This worked effectively to prevent German submarines travelling through the Channel. However, once France fell in June 1940, the barrage was no longer practical. Maintaining the minefields or patrols close to the French coast was impossible due to the threat from coastal guns, aircraft and surface patrols. This opened up routes for German shipping along the French coast. These routes were mainly used by merchant shipping - blockade runners and ships carrying supplies to and from western France - but a few destroyers made the trip to operate from bases like Brest. It was not the safest route, as it was exposed to British raids and minelaying; there were several ambushes or attempted ambushes of convoys travelling on the route and a number of ships struck mines. Larger ships never made the passage from Germany to the Atlantic through the Channel, but they did make the return journey on one occasion. This was Operation Cerberus, the notorious Channel Dash. This involved three German ships, the large cruisers Gneisenau and Scharnhorst and the heavy cruiser Prinz Eugen, which had carried out raids in the Atlantic and were now in the French port of Brest. They were ordered to return to Germany to avoid the frequent bombing raids they were exposed to in Brest, and so that they could operate against the Arctic convoy routes; the Channel route was deemed to be safer than trying to head around Britain. While the Channel was well defended, a combination of poor intelligence, bad weather, miscommunications between the RN and RAF and a generous helping of bad luck meant that the British attacks were piecemeal and ineffective. The German ships made it through the Channel unharmed, but would run into a minefield that the RAF and RN had hurriedly laid along their likely route along the coast of the Netherlands.
The route through the North Sea was much more commonly used. The North Sea was much wider than the English Channel, with more space to slip past British patrols. While the route was longer (and thus reduced the endurance of raiders or submarines), it was so much safer than the Channel that it was the main route used. Until 1940, merchant ships could even use the waters of neutral Norway as a safe haven, travelling through them without fear of capture by the British. It was, however, rarely used by more than one ship. The German fleet as a whole never tried to travel out into the Atlantic in either world war. In WWI, it was constrained to the North Sea by a combination of risk, the need to protect the German coast against invasion and fuel concerns. In WWII, the German Navy preferred to use smaller raiding groups, with a maximum of two ships operating together at one time. It was easy to keep small groups like these together, as the ships could just stay within visual range of each other. The British did patrol the exits from the North Sea, with patrol lines in the Greenland-Iceland-UK (GIUK) Gap. These patrols were generally made by Armed Merchant Cruisers, there to catch merchants. They could not stand up to proper warships, but sufficed to counter German merchant raiders; if German warships were out, they could be reinforced by British warships. Submarines were much harder to catch, and so the RN preferred to attempt to fight them in the Atlantic. However, there were attempts to lay mine barrages against U-boats in both world wars. After the American Navy entered WWI in 1917, they made an attempt to lay a vast mine barrage across the North Sea, running from the Orkneys to Stavanger in Norway. By the end of the war, ~70,000 mines had been laid, with the majority of the North Sea covered. This claimed six U-boats sunk and another six heavily damaged. In 1940, the British tried another mine barrage, the Northern Barrage. This time, they laid several vast fields in the GIUK gap. These may have claimed several U-boats, but also caused the destruction of six merchants and an escort from the convoy QP13, which blundered into a Northern Barrage field due to a navigational error.