There is no bus connection between Leuven or Brussels and Luxembourg. So you have to go by train. There is an hourly direct train from Brussels to Luxembourg. There is no direct train from Leuven. You have to make a connection in Ottignies (on the Brussels-Luxembourg line). There is at least one train per hour between Leuven and Ottignies. Alternatively, you can travel through Liège (Luik). There is one train per hour between Leuven and Liège and one train every two hours between Liège and Luxembourg. Note that the ride from Liège to Luxembourg is a quite scenic one.
You can book tickets via SNCB Europe, the international website, as Luxembourg is not in Belgium. The price for a return ticket is 43 EUR in the second class and 72 EUR in the first class. This is a fixed price, as explained here. As there are no highspeed trains involved on this route, you don't have to book the ticket in advance. You can buy it at the train station, even just before the departure of the train. The ticket is valid on any train on the route.