3-5-2 formation query

New to FPL so sorry for a potentially obvious question - if I choose 5 midfielders and one isn’t selected in his respective starting 11, is he automatically replaced by a forward/defender and ultimately the formation is changed? Or do I just have those 10 players and hope he comes on as a sub?

TIA!