Function 00h reprograms the whole card for the mode in AL: resolution and timing, the memory layout, the font for a text mode and the default palette. Then it clears video memory (spaces in attribute 07h in text modes, colour 0 in graphics modes), shows page 0, puts every page's cursor at the top left and sets the usual cursor shape. It records all of this in the BIOS data area, so afterwards INT 10h AH=0Fh and every other service know the new mode.

Usually it is written MOV AX, 0013h / INT 10h: AH = 00h and AL = the mode in one instruction. The modes are listed in the INT 10h article. Here the screen switches to 40-column text; DOS output follows the new mode, since DOS writes through the BIOS:

Prints "Forty columns: big letters" and "Back in mode 03h"; on the screen the first line shows in wide 40-column text for 2 seconds, then the screen is cleared back to 80×25.
MOV AX, 0001h ; AH = 00h: set the mode; AL = 01h: 40x25 colour text
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG1 ; DOS output, now in double-width letters
INT 21h
MOV CX, 001Eh ; wait 2 s: CX:DX = 1E8480h microseconds
MOV DX, 8480h
MOV AH, 86h ; BIOS: wait
INT 15h
MOV AX, 0003h ; mode 03h again: 80x25 text, clears the screen
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG2
INT 21h
MSG1 DB "Forty columns: big letters", 13, 10, "$"
MSG2 DB "Back in mode 03h", 13, 10, "$"

Setting the old mode back

A program that changes the mode must set the old one again before it exits. Otherwise DOS is left in, say, a graphics mode, where the BIOS draws its text slowly dot by dot and the command line is hard to use. Ask for the mode first with function 0Fh and restore exactly that:

MOV AH, 0Fh ; get the mode: AL
INT 10h
MOV [OLDMODE1], AL ; keep it
; ... set another mode, draw ...
MOV AH, 00h ; set the mode
MOV AL, [OLDMODE1] ; the one we found
INT 10h

Keeping the screen

On the EGA and later, bit 7 of AL asks the BIOS not to clear video memory: MOV AX, 0083h sets mode 03h and leaves the text where it is. Programs use it to reset the card, or the font, without wiping what the user was looking at. Function 0Fh may then report the mode with bit 7 set.

Pitfalls

A mode set is slow by video standards, since the card is reprogrammed and its memory cleared, and the monitor may blink while it resynchronises; to clear the screen use INT 10h AH=06h instead. It also undoes everything a program changed: palette and DAC colours, a loaded font, 43 or 50 lines, bright backgrounds, the cursor shape. That makes "set mode 03h" the simple way to put everything back at the end. A mode the card does not support is ignored by most BIOSes and produces a garbled screen on others, so check what card is present (INT 10h AH=1Ah, INT 10h AH=12h) before asking for EGA or VGA modes.