Nifty 50 is an Index comprising of 50 stocks and can’t be bought. In order to buy the Index, you’ll have to buy the constituent 50 stocks in the same weightage as they hold on the Index.
Alternatively, you can also buy NiftyBees, the ETF on the Index which will replicate the performance of the Index.