Answer: The Mishna (Pesachim 119b) teaches that we mustn’t eat anything after the pesach afikoman. We include this halacha in our answer to the chacham, wise son. Rambam (Chametz Umatza 8:9) writes that nowadays when we don’t have the korban pesach, one mustn’t eat after the afikoman.
The rishonim offer various reasons for this. According to Rambam this is to ensure that the taste of the matza remains in one’s mouth. The Baal Hamaor (Pesachim 119b) explains that immediately after eating, everyone would go outside and sing hallel on the rooftops. It was important not to eat anything else that may have delayed them. The Ramban (Milchamos Hashem), however, explains that the reason is that the afikoman had to be eaten at the end of the meal with the korban Pesach which must be eaten when a person is full.
There is a machlokes, however, as to whether this restriction applies to drinks, too. The Gemara Yerushalmi (Pesachim 71b) teaches that one mustn’t drink as one needs to stay sober. The Tur (OC 481:2 quoting Rabbeinu Yonah) explains that this is to ensure that one can properly fulfil the mitzva of relating over the story. While the Rif (Pesachim 27a) only allows one to drink water afterwards, the Rosh (Pesachim 10:33) writes that one may drink any non-alcoholic beverages. Ramban (ibid.) and the Ran (Pesachim 119b), however, write that having other drinks gives the impression that one is adding to the four cups and trying to start a second seder.
Following this, the Shulchan Aruch (OC 481:1) writes that one may only drink water after the four cups. The Mishna Berura (478:2; 481:2) explains that different drinks would be problematic depending on which reason one follows, though the acharonim permit mild drinks such as fruit juice and tea.
The Baer Heitev (481:1) writes, however, that there is a machlokes as to whether it is ideal to have coffee or not. The Mishna Berura writes that it is ideal for one to be stringent on the first night seder and avoid it (See Shulchan Aruch Harav OC 481:1). R’ Ephraim Greenblatt (Rivevos Ephraim 1:317; 3:319:1) notes, though, that the Chassam Sofer would customarily drink coffee following his Seder. One is allowed to drink coffee if it would help them stay awake for the seder.
In conclusion, one may drink coffee even after eating afikoman if they feel that it will help them stay awake and continue the mitzvos of the seder.