For optimal muscle growth rate, you would be in a calorie surplus, consume sufficient protein, and spread those protein servings out over the course of the day. (In conjunction with meaningful resistance/weight training).

However, not everyone has the goal of getting bigger that would inevitably come from a calorie surplus. If weight loss is the goal and you are in a calorie deficit nothing changes with regards to the aforementioned (obviously not in a surplus) it’s just your muscle growth rate would be blunted.
In both cases, it would always be a good idea to support your training with nutrition that builds muscle mass/maintains muscle mass. As building muscle is a very slow process.
In your first year of resistance training with your nutrition and obviously training being on point you could expect to build circa 25 lbs (genetics and hormones would have a bearing on this). Every subsequent year the amount of muscle you could potentially build roughly halves!
So let’s have a look at how your nutrition can facilitate that.
What’s the best way to optimize my protein intake?
To maximize muscle protein synthesis spreading out your daily protein requirement over the day would be a good idea. A meal containing circa 25-30grams of protein would potentiate muscle protein synthesis (growth). The frequency is dependant on your personal preference (however the longer you have been weight training the more you would benefit from higher frequencies).

Is it true your body can only use 30grams of protein?
No. Your body will absorb ~95% of the protein that you take in.
What happens when you have a meal containing more than 30grams of protein?
In a large serving of protein, ~30g will go towards muscle protein synthesis (muscle repair/build). The additional will be oxidized (used) by the body or stored in the small intestines.
Is all protein the same?
No. Animal proteins are complete proteins. That means they contain all the essential amino acids that you need in your diet. Plant proteins are often, but not always, incomplete sources of protein.
How much protein should I be trying to get per meal?
To maximize muscle synthesis and reduce hunger it would be prudent to aim for 25 – 30grams of protein per meal.

Is too much protein dangerous?
High protein intake may cause harm in people with diagnosed kidney disease, but the same doesn’t apply to people with healthy kidneys.
Protein Supplements
Whey protein
Whey protein is derived from milk, which is made of two proteins whey and casein. Whey is faster acting than casein and is considered a complete protein as it contains all the essential amino acids, it is also low in lactose content. Whey protein is a convenient supplement and relatively inexpensive over cooking a meal high in protein. It can also assist you if you are struggling to hit your protein target through regular meals. There is no scientific evidence that too much protein is detrimental to health, only if you have a pre-existing kidney condition.
BCAAs
Branched Chain Amino Acids (BCAAs) refer to three amino acids: leucine, isoleucine, and valine.
For people with low dietary protein intake, BCAA supplementation can promote muscle protein synthesis and increase muscle growth over time. Supplementation can also be used to prevent fatigue in novice athletes.
BCAAs can be helpful, but many protein sources, such as meat and eggs, already provide BCAAs. Supplementation is unnecessary for people with a sufficiently high protein intake.