See a doubly linked list keep next and prev pointers as you prepend, append, search and delete the head. Worked example searching for 40, with your own values.
About this algorithm
A doubly linked list is a chain of nodes where each node stores a value, a next pointer to the node after it and a prev pointer to the node before it. The extra pointer lets you walk the list in both directions and remove a node you already hold in constant time. The cost is one more pointer per node to store and to keep correct.
Use a doubly linked list when you often insert or remove in the middle at a node you already have, or need to move both ways: an undo and redo history, a browser's back and forward pages, a playlist with previous and next, or the recency list inside an LRU cache, which pairs it with a hash map. A singly linked list is enough, and smaller, when you only ever move forward, as in a stack or a simple queue. A circular list fits when the last item should lead back to the first. If you mostly read by position, use an array, since a list has to be walked to reach index i.
Create the node, set its next to the current head and the old head's prev to the new node, then move head to it. A fixed handful of pointer writes, so O(1).
Set the tail's next to the new node and the new node's prev to the tail, then move tail to it. Keeping a tail pointer is what makes this O(1).
Point node.prev.next at node.next and node.next.prev at node.prev, with the head and tail as special cases. A singly linked list cannot do this without first walking from the head to find the node before.
Start at the head and follow next pointers, comparing values, until you find the target or reach null. If you know the target is near the end, start at the tail and follow prev pointers instead.
The page loads seven nodes, 10, 20, 30, 40, 50, 60 and 70, with arrows drawn both ways. Press Play and it searches for 40 from the head. It compares 10, then 20, then 30, moving along next each time, and finds 40 at index 3 after 4 comparisons. Starting from the tail and following prev would also take 4 comparisons here (70, 60, 50, 40), because 40 is the middle node. Removing that 40 once it is found takes two pointer changes: 30's next now points at 50, and 50's prev now points at 30.
Most doubly linked list bugs are an update made in one direction only. After every insert or remove, every node should satisfy node.next.prev equals node. Dummy head and tail nodes that never hold data remove the special cases for an empty list and for the two ends.
Time: inserting or removing at the head, the tail or a node you hold changes a fixed number of pointers, O(1), while a search may visit all N nodes, O(N). Space: the list itself is O(N), with two pointers per node instead of one; each operation needs only O(1) extra.