According to his entry in Wikipedia, Deadpool's first appearance ever was in comics, in 1991:
Created by artist/writer Rob Liefeld and writer Fabian Nicieza, Deadpool made his first appearance in the pages of The New Mutants #98 cover dated February 1991.
But breaking the fourth wall did not happen for most of that decade:
In 1997, Deadpool was given his own ongoing title, initially written by Joe Kelly (...) Reportedly Kelly introduced the fourth wall breaking gimmick.
So for the first six years of publication, he could only break up to the third wall.
Just as a curiosity, crossing the info from Wikipedia with the info on this CBR article indicates that the first time Deadpool broke the 4th wall was in the last panel of this page in Deadpool #0:
Source: the same link as above, https://www.cbr.com/deadpool-fourth-wall-breaking-villain/
Deadpool first appearance in videogames was in X-Men Legends II: Rise of Apocalypse, from 2005. He had long been an expert in 4th wall demolitions by then and does break the 4th all in this game. In fact this is the media where he goes the farthest through 4th walls; in at least one game (Marvel vs. Capcom 3) he will go as far as grabbing his own life bar and wielding it as a blunt weapon against his opponents.
And then there are the Fox movies. He was not breaking any 4th walls in 2009 X-Men Origins: Wolverine, but when he did get his own movie in 2016 his previous Hollywood incarnation got retconned into not being the official one. In the 2016 movie, he is never seen breaking the 4th wall in the flashbacks of his life before getting his mutation activated - so it seems like an acquired power.
Las but not least: he was never the first Marvel character to blatantly break the 4th wall. She-Hulk had been doing it since 1989, but she never got as much love as Deadpool. I remember other characters doing it too, but this is all I can find a reference for right now.