Reduction of carbonyl groups
Sodium borohydride is a weaker reducing agent than, say, lithium aluminium hydride, so, although it will react with ketones and aldehydes, it is not strong enough to react with carboxylic acids or esters. This generalization is quite broadly applicable, so you already know your borohydride will reduce the ketone carbonyl on that molecule. $\ce{NaBH4}$ is a weaker reducing agent than $\ce{LiAlH4}$ because boron is less electropositive than aluminium. Boron has a Pauling electronegativity of 2.04 while aluminium's pauling electronegativity is only 1.61, therefore $\ce{NaBH4}$'s hydrides are significantly less nucleophilic and they won't be able to react with a weaker electrophile.

To answer your question directly, you have to think about which carbonyl is more electrophilic. Generally, resonance effects are more important than inductive effects when considering something's nucleophilicity/electrophilicity.



The ketone has two resonance forms, while the ester has three, therefore the partial positive charge on the carbon is more delocalized on the ester, making the ketone more electrophilic. The weak $\ce{H-}$ nucleophile provided by $\ce{NaBH4}$ will only be able to react with the stronger electrophile, the ketone.