The 21-year-old has joined the newly promoted side as their sixth summer signing.
Forest are looking to retain their top flight status at the first time of asking following a 23-year absence.
Steve Cooper's side have already signed Manchester United goalkeeper Dean Henderson on loan, Nigeria striker Taiwo Awoniyi, Omar Richards, Moussa Niakhate and Giulian Biancone.
Williams came through the Liverpool ranks and made 33 appearances for the first team after breaking into the side during the 2019/2020 season.
The Wales international spent the second half of last season on loan at Fulham, helping the Cottagers to Premier League promotion with two goals and two assists in 14 appearances.
"I'm really excited to join Nottingham Forest and to help this great club move forwards in the Premier League," said Williams of the move.
"Forest are a club with incredible history and the City Ground is a very special venue that I can't wait to experience in full voice in the coming weeks.
"Having spoken to the head coach, there's a huge amount of ambition being shown at the club and I can't wait to join up with my new team-mates and get ready for the challenge ahead."
Forest manager Cooper added: "Despite being only 21, Neco has established himself in the Wales starting XI."
"He's played in the Premier League, the Champions League and in World Cup qualifiers in the last 12 months and he is a very talented right back.
"We believe that he's got an incredibly high ceiling and that he can play a huge role for us at Nottingham Forest in our return to the Premier League. We're delighted to have him on board."