Don’t expect others to do your homework for you. Explain why you are having any difficulty, being as specific as you can, and you will find people happy to explain general prolog principles which will help you solve specific problems.
Anyway, here’s a brief session using Linux; although judging from your response, I suspect I haven’t given you a useful answer. The lines that start with “$” are command line prompts from the shell; the lines that start with “?-” are prompts for query from SWI-Prolog; the ";"s were entered by the user, to get additional results that satisfy the query.
$ cat p.pl
p('Estonia', '+372', 'Tallinn', 1154, 444532).
p('Latvia', '+371', 'Riga', 1201, 614618).
p('Lithuania', '+370', 'Vilnius', 1323, 588412).
list_facts(List) :-
bagof(p(Country, Something, City, Age, Population),
p(Country, Something, City, Age, Population),
List).
fact(P) :-
member(P, [p('Estonia','+372','Tallinn',1154,444532),
p('Latvia','+371','Riga',1201,614618),
p('Lithuania','+370','Vilnius',1323,588412)]).
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.5.9)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- [p].
true.
?- p(Country, Something, City, Age, Population).
Country = 'Estonia',
Something = '+372',
City = 'Tallinn',
Age = 1154,
Population = 444532 ;
Country = 'Latvia',
Something = '+371',
City = 'Riga',
Age = 1201,
Population = 614618 ;
Country = 'Lithuania',
Something = '+370',
City = 'Vilnius',
Age = 1323,
Population = 588412.
?- list_facts(List).
List = [p('Estonia', '+372', 'Tallinn', 1154, 444532), p('Latvia', '+371', 'Riga', 1201, 614618), p('Lithuania', '+370', 'Vilnius', 1323, 588412)].
?- fact(P).
P = p('Estonia', '+372', 'Tallinn', 1154, 444532) ;
P = p('Latvia', '+371', 'Riga', 1201, 614618) ;
P = p('Lithuania', '+370', 'Vilnius', 1323, 588412).
?-
% halt
$