You should always keep “Best friend” as two words. It's correct to do this because we use “best” as an adjective to modify the word “friend.” This shows that someone is our closest friend. There is never a reason to group the words, so “bestfriend” is incorrect.