Create a text frame on a Master Page (left & right) and with cursor inside the frame mouse right click>Insert Special Character>Marker>Current Page Number.
@Wichtel – "Randnummern", automatic page numbering is one of the oldest features in InDesign making use of text variables. You can set them on master pages (they will be reflected as real page numbers according to your numbering definitions on the pages you apply the masters to).
Or, you can set them on a page itself. They are special characters. In the German UI under the term "Marken", you can insert them at any insertion point of your text cursor.
Set the curser inside a text frame, could be empty or not, right click and you get access to them:
Or use the keyboard shortcut…
Hm, maybe you do yourself a favour and visiting a course about working with InDesign or you could buy a book about InDesign like this one: