Go to Options, then choose Enter Code. That is where the codes are typed in.
The menu is easy to miss because it sits alongside the ordinary settings rather than in a dedicated extras screen. Once you are in Options, look for the code entry line, type the code exactly as given, and confirm.
Check the spacing and capitalisation first. These fields tend to be unforgiving, and a trailing space is enough to make a valid code fail. Also confirm the code belongs to Beach Friends specifically, since the Littlest Pet Shop DS titles each have their own lists and codes do not carry across.
If it still will not take, the code may have been for a different region's release. Re-releases and regional versions occasionally differ in what they accept.