In order to upgrade to newer Mac OS X from older Leopard 10.5.8, you'd need
to buy the retail install DVD for Snow Leopard 10.6.3 from Apple online store.
• Mac OS X 10.6 Snow Leopard - Apple
https://www.apple.com/shop/product/MC573Z/A/mac-os-x-106-snow-leopard
With that installed and updated to last supported steps, then you may access
the Mac App Store to see what else you may (or not) download and install.
Some older Macs are best to not upgrade past OS X Snow Leopard 10.6.8;
these are older/unsupported and most do not have later browser update.
The exact build model year number could be helpful to use & see what the
MacBook could be upgraded to run; but some can only go to Lion 10.7.5;
and that's hardly an improvement over 10.6.8; and older PPC based software
won't run in the later Lion. Good useful stuff, but unsupported past SL 10.6.8.