In its most simplistic form ….
switch(config) ip routing
switch(config) router ospf (process-ID)
I am not going to go into anymore detail because OSPF can be configured many different ways depending on the requirements. But in addition to the two commands above, you will need to specify networks and area’s such as
network 1..1.1.0 0.0.0.3 area 0
Also you might want to look into creating loopack intefaces and making then the router ID for OSPF, since loopback intefaces never go down
ip address 126.96.36.199 255.255.255.252
router ospf 1