If the cake is iced, put it in the freezer uncovered until frozen. Then, cover with plastic wrap such as Saran Wrap followed by 2 layers of aluminum foil. Freeze up to 1 year.
If the cake is not iced, the best way is to place in a plastic vacuum bag and remove as much air as possible. Then, wrap in foil.